shhyou / ypsilon-fork

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

syntax-case bug #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. download my library
http://www.phyast.pitt.edu/~micheles/scheme/sweet-macros.zip

2. try the following script 

$ cat meta2.ss
#!r6rs
(import (rnrs)
        (for (sweet-macros) (meta 0) (meta 1))
        (for (only (rnrs) begin lambda display) (meta 2)))

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

(display (m))

What is the expected output? What do you see instead?

In Ikarus, Larceny, PLT Scheme and Mosh I get

$ ikarus --r6rs-script meta2.ss
at meta-level 2
at meta-level 1
expanded-m

In Ypsilon I get an error:
$ ypsilon meta2.ss 

error: identifer vars out of context
  >  (syntax-case
       x
       (<source> <transformer>)
       ((m2 <transformer>)
        (syntax
       ...
  ..."/home/msimionato/gcode/artima/scheme/meta2.ss"

expanding:
  >  (syntax-case
         x
         (<source> <transformer>)
         ((m2 <transformer>)
          (syntax
            (...
              (begin
                (display "at metalevel 2\n")
                (lambda (x) "expanded-m\n")))))
         ((m2 <source>)
         ...
  ..."/home/msimionato/gcode/artima/scheme/meta2.ss"
  *  (def-syntax m2 (begin (display "at metalevel 2\n") (lambda (x)
"expanded-m\n")))
  ..."/home/msimionato/gcode/artima/scheme/meta2.ss" line 8
  *  (def-syntax
         m
         (let ()
           (def-syntax
             m2
             (begin (display "at metalevel 2\n") (lambda (x) "expanded-m\n")))
           (define _ (display "at metalevel 1\n"))
           (lambda (x) (m2))))
  ..."/home/msimionato/gcode/artima/scheme/meta2.ss" line 6

What version of the product are you using? On what operating system?

Ypsilon 0.9.6-update3, Fedora Linux 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by michele....@gmail.com on 6 May 2009 at 1:19

GoogleCodeExporter commented 9 years ago
Thank you for your bug report!
The identifier 'vars' come from macro expander generated code, and it seems 
leaked
unexpectedly.
--fujita

Original comment by y.fujita...@gmail.com on 7 May 2009 at 1:16

GoogleCodeExporter commented 9 years ago
I have fixed the bug and trunk directory is updated to revision 445.
Please try. Thank you!
-- fujita

Original comment by y.fujita...@gmail.com on 7 May 2009 at 4:43