[racket] A macro's `require' works in module but not in REPL

From: Robby Findler (robby at eecs.northwestern.edu)
Date: Sat Oct 20 12:21:48 EDT 2012

On Sat, Oct 20, 2012 at 9:54 AM, Greg Hendershott
<greghendershott at gmail.com> wrote:
>> net/uri-codec is not required (directly) into use.rkt. Instead, it is
>> required at the definition of the macro and then a reference to that
>> module is inserted into use.rkt. The macro system can track such
>> references without explicitly having requires.
> OK I see. Thanks!
>> BTW, the same thing is happening with 'define'...  :)
> Ah. Point.
> (Although ... I was assuming `define' was imported on account of
> use.rkt requiring racket or racket/base. So I wasn't surprised that
> was working.)

That define turns out to be the same define in this case, but it isn't
always. And if they are different, you get the define that is around
at the place where the macro is defined, not the one where it is used.


Posted on the users mailing list.