Is there any way to define a macro that expands out to a lambda, and then access the arguments passed to that lambda from outside the macro in the calling context?<br>Here's an example of what I mean:<br><br><font class="Apple-style-span" face="'courier new', monospace">#lang racket<br>
<br></font><div><font class="Apple-style-span" face="'courier new', monospace">(define-syntax-rule (foo form ...)<br> ((lambda (bar) form ...) "ARG"))<br><br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">(foo "Hello") ; => returns "Hello"<br>
<br></font></div><div><font class="Apple-style-span" face="'courier new', monospace">(foo bar) ; => expand: unbound identifier in module in: bar</font><br></div><div><font class="Apple-style-span" face="'courier new', monospace"><br>
</font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">I'd like access to the "bar" argument on the last line. Is this possible with Racket macros?</font></div>
<div><font class="Apple-style-span" face="arial, helvetica, sans-serif"><br></font></div><div><font class="Apple-style-span" face="arial, helvetica, sans-serif">Thanks,<br>Daniel</font></div>