[gambit-list] Intermixing syntax-rules and define-macro
patrickli.2001 at gmail.com
Thu Sep 27 18:34:45 EDT 2012
I am having some issues with the subtleties of the low-level define-macro
system. The problem seems to be that the identifiers created by
syntax-rules are not equivalent to the identifiers created by define-macro.
I would really appreciate some help on this.
Here is a small example:
((multi-let (vars ...) body ...)
(let* [(vars '()) ...] ;; Declare the variables
($set vars) ... ;; Set them to "initial"
(define-macro ($set var)
`(set! ,var "initial")) ;; Set the variable to "initial"
And here is what happens when I try to use it:
> (multi-let (x y z) x)
*** ERROR IN #<procedure #2> -- Unbound variable: x
Thank you very much! For my use case, I am unable to stick completely to
using define-syntax thus have to deal with how to intermix these two
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Gambit-list