In this example it should return "ARG".<div><br><div class="gmail_quote">On Fri, Sep 16, 2011 at 1:08 PM, Matthias Felleisen <span dir="ltr"><<a href="mailto:matthias@ccs.neu.edu" target="_blank">matthias@ccs.neu.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
What should (foo bar) return?<br>
<div><div></div><div><br>
<br>
On Sep 16, 2011, at 3:46 PM, Daniel MacDougall wrote:<br>
<br>
> 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>
> #lang racket<br>
><br>
> (define-syntax-rule (foo form ...)<br>
> ((lambda (bar) form ...) "ARG"))<br>
><br>
> (foo "Hello") ; => returns "Hello"<br>
><br>
> (foo bar) ; => expand: unbound identifier in module in: bar<br>
><br>
><br>
> I'd like access to the "bar" argument on the last line. Is this possible with Racket macros?<br>
><br>
> Thanks,<br>
> Daniel<br>
</div></div>> _________________________________________________<br>
> For list-related administrative tasks:<br>
> <a href="http://lists.racket-lang.org/listinfo/users" target="_blank">http://lists.racket-lang.org/listinfo/users</a><br>
<br>
</blockquote></div><br>
</div>