Black Hole provides this with an pretty-much-as-well-as-can-be-done quality.<br><br><div class="gmail_quote">2012/9/28 Patrick Li <span dir="ltr"><<a href="mailto:patrickli.2001@gmail.com" target="_blank">patrickli.2001@gmail.com</a>></span><br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div>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.</div>


<div><br></div><div>Here is a small example:</div><div><br></div><div><div>(define-syntax multi-let</div><div>  (syntax-rules ()</div><div>    ((multi-let (vars ...) body ...)</div><div>     (let* [(vars '()) ...] ;; Declare the variables</div>


<div>       ($set vars) ...    ;; Set them to "initial"</div><div>       body ...))))</div><div><br></div><div>(define-macro ($set var)</div><div>  `(set! ,var "initial"))   ;; Set the variable to "initial"</div>


</div><div><br></div><div><br></div><div>And here is what happens when I try to use it:</div><div>> (multi-let (x y z) x)</div><div>*** ERROR IN #<procedure #2> -- Unbound variable: x</div><div><br></div><div>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 systems properly.</div>

<span class="HOEnZb"><font color="#888888">
<div>  -Patrick</div>
</font></span><br>_______________________________________________<br>
Gambit-list mailing list<br>
<a href="mailto:Gambit-list@iro.umontreal.ca">Gambit-list@iro.umontreal.ca</a><br>
<a href="https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list" target="_blank">https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list</a><br>
<br></blockquote></div><br>