[plt-scheme] chaining module begin
I am having trouble figuring out why the following does not work. I want to
create a module language that provided its own #%module-begin interms of
another module language that does that same. However, I get an error that
#%app is unhappy:
module-begin-problem.ss:15:4: compile: bad syntax; function application is
not allowed, because no #%app syntax transformer is bound in: (syntax-case
stx () ((_ expr ...) (syntax (#%module-begin (write 2) expr ...))))
-mike
;;;;;;;;;;
;; Start Code
(module foo mzscheme
(provide (all-from-except mzscheme #%module-begin)
(rename module-begin #%module-begin))
(define-syntax (module-begin stx)
(syntax-case stx ()
[(_ expr ...)
#'(#%module-begin
(write 1)
expr ...)])))
(module bar foo
(provide (all-from-except mzscheme #%module-begin)
(rename module-begin #%module-begin))
(define-syntax (module-begin stx)
(syntax-case stx ()
[(_ expr ...)
#'(#%module-begin
(write 2)
expr ...)])))