[plt-scheme] (module) expanded from a macro

From: Dan Muresan (danmbox at gmail.com)
Date: Sun Oct 22 13:38:11 EDT 2006

Hi, I'm wondering why the following doesn't work:

(define-syntax xmodule
    (syntax-rules ()
      ((_ name (export ...) def ...)
       (module name mzscheme (provide export ...)
         def ...))))

  (xmodule mod (mac) (define-syntax mac (syntax-rules () ((_ x) x))))

I get:

compile: bad syntax; function application is not allowed, because no
#%app syntax transformer is bound in: (syntax-rules () ((_ x) x))

However, plain definitions work inside xmodule.

-- Dan


Posted on the users mailing list.