[racket] ok what's wrong there 'syntax-rule' evaluating its operand (??)

From: Thomas Lynch (thomas.lynch at reasoningtechnology.com)
Date: Thu Jan 15 03:30:31 EST 2015

thank you! ..  of course that makes sense.  I guess that gensym and
uninterned symbols have something to do with this?

The identifiers in the macro are 'interned' (is that the terminology?
rather than renamed?) so in fact table-auth was never defined.  Then at run
time there are complaints as such.  Most all macro expanders work this way,
though we might have some way to distinguish which identifiers get munged.

. so is there a simple way to communicate with  define-syntax-rule and tell
it not to íntern' certain identifiers in its body? ... '(native
table-author ...) or some such? ..  Of course there is always the
define-syntax.

On Thu, Jan 15, 2015 at 3:28 PM, Daniel Prager <daniel.a.prager at gmail.com>
wrote:

> Hi Thomas
>
> IIUC you get an error with your original syntax-rules version because
> syntax-rules (and syntax-case and syntax-parse) is hygienic by default. In
> this case think of table-author etc. being renamed inside the macro to
> avoid clashing with variables defined in the calling code. Hence the
> undefined error in the calling code.
>
> You *want* and expect it to be defined by the macro, but the default
> behavior says otherwise, and needs to be explicitly over-ridden.
>
>
> Dan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150115/12083946/attachment.html>

Posted on the users mailing list.