[plt-scheme] let-syntax bug

From: Andre van Tonder (andre at het.brown.edu)
Date: Tue Apr 6 10:47:36 EDT 2004

After some more thought, it seems to me that the failure of MzScheme on
the following should probably be regarded as a bug (unless the bug is in
my model below):

(let-syntax 
    ((test (syntax-rules ()
             ((test name) (define-syntax name
                            (syntax-rules ()
                              ((name) 'hello)))))))
  (test test1))

      ;==> fails

(test1)    ;==> should give 'hello

According to my understanding of syntax-rules/case, the let-syntax
transformer should expand as follows, where identifiers introduced in
the template transcription are given a new color:

(define-syntax~1 test1
  (syntax-rules~1 ()
    ((test1) 'hello)))

Now, since there is no enclosing binding for the identifiers,
define-syntax~1 and syntax-rules~1, we can erase the color to get

(define-syntax test1
  (syntax-rules ()          
    ((test1) 'hello)))

which should then execute normally.  Am I using the wrong model?  This is
breaking some macro-generating macros which I am trying to express using
syntax-rules.     

Best regards
Andre







Posted on the users mailing list.