[plt-scheme] full-expanded syntax and internal definitions

From: Dave Herman (dherman at ccs.neu.edu)
Date: Sun Aug 5 14:05:29 EDT 2007

> No, so there no local macro definitions in fully expanded code.

If that's true then this must mean that local-expand is not guaranteed 
to produce fully-expanded code?

 > (define-syntax (quote-expand stx)
     (syntax-case stx ()
       [(_ e)
        (with-syntax ([exp (local-expand #'e 'expression '())])
          #'(quote exp))]))
 > (quote-expand (lambda ()
                   (define-syntax foo (syntax-rules () [(_) 42]))
                   (define y 10)
                   y))
(lambda () (letrec-syntaxes+values (((foo) (syntax-rules () ((_) 42)))) 
(((y) (#%datum . 10))) y))

Dave


Posted on the users mailing list.