[plt-scheme] macros for macros

From: Jim Blandy (jimb at redhat.com)
Date: Thu Jul 21 11:02:51 EDT 2005

Why doesn't this work?  I'd like it to display "hi".  Must I put the
definition of x in its own module, and require-for-syntax it?

(module foo mzscheme

  (begin-for-syntax
   (define-syntax x
     (syntax-rules ()
       ((x y) y))))

  (define-syntax y
    (lambda (s)
      (syntax-case (x s) ()
        ((y foo) (syntax foo)))))

  (display (y "hi"))
  (newline))



Posted on the users mailing list.