SapphireDensetsu / ypsilon

Automatically exported from code.google.com/p/ypsilon
Other
0 stars 0 forks source link

Syntax definitions are evaluated more times than expected #96

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
This is from Michele Simionato on the plt mailing list

;;; call this file meta2.ss
#!r6rs
(import (rnrs) (for (only (rnrs) begin lambda display) (meta 2)))

(define-syntax m
  (let ()
    (define-syntax m2
      (begin
        (display "at metalevel 2\n")
        (lambda (x) "expanded-m\n")))
    (define _ (display "at metalevel 1\n"))
    (lambda (x) (m2))))

(display (m))

and run
 ypsilon --r6rs meta2.ss

I expect to see:

at metalevel 2
at metalevel 1
expanded-m

What I see is:

at metalevel 2
at metalevel 1
expanded-m
at metalevel 1  ;; why is this here?

This is on Ypsilon 0.9.6-update3 

Original issue reported on code.google.com by aghul...@gmail.com on 1 May 2009 at 7:40

GoogleCodeExporter commented 8 years ago
It is macro expander's bug that causes transformer expressions wrongly evaluated
again with initialization expressions. I have fixed bug in revision 440.
Please try. Thank you! :)
-- fujita

Original comment by y.fujita...@gmail.com on 2 May 2009 at 12:47