Wrong macro expansion order
Issue #285
resolved
This should print bar
but instead it raises an error
(library (foo)
(export define-define)
(import (rnrs))
(define-syntax define-define
(lambda (x)
(syntax-case x ()
((_ name)
#'(define-syntax name
(lambda (xx)
(syntax-case xx ()
((_)
#'(syntax-rules ()
((_) (begin (display 'name) (newline))))))))))))
)
(library (bar)
(export definer)
(import (rnrs)
(foo))
(define-define bar)
(define-syntax definer (bar))
)
(import (bar))
(definer)
Comments (2)
-
reporter -
reporter - changed status to resolved
Fixing macro generating macro generating macro issue. Fixes
#285→ <<cset 72f2d503c773>>
- Log in to comment
The problem is that we first expand
define-syntax
then expand macro, however in this case,define-define
creates a macro, which will be expanded afterdefine-syntax
is processed