[plt-scheme] expression context and units
I don't know if this is a bug, but it seems odd to me:
(require (lib "unitsig.ss")
(lib "servlet-sig.ss" "web-server"))
(define test1 'test1)
(define-syntax foo1
(syntax-rules ()
[(_ bar)
(define bar (quote bar))]))
(foo1 x)
(module m mzscheme
(provide (all-defined))
(define test3 'test3)
(define-syntax foo3
(syntax-rules ()
[(_ bar)
(define bar (quote bar))]))
(foo3 xxx))
(unit/sig ()
(import servlet^)
(define-syntax foo4
(syntax-rules ()
[(_ bar)
(quote bar)]))
(define xxxx (foo xxxx)))
(unit/sig ()
(import servlet^)
(define test2 'test2)
(define-syntax foo2
(syntax-rules ()
[(_ bar)
(define bar (quote bar))]))
(foo2 xx))
; define: not allowed in an expression context in: (define xx (quote xx))
So, at the top level, a (define-syntax) does not leave expression
context, while in a unit it does, but only if the syntax has a define
inside IT.
--
Jay McCarthy <jay.mccarthy at gmail.com>
http://jay.makeoutcity.com/