[Prev][Next][Index][Thread]

Re: Can macros define anonymous locals?



in article 3AB5C51A.62494935@lucent.com, Gabor Greif at ggreif@lucent.com
wrote on 2001.03.19 12:36 AM:

> Dylan macros are hygienic, i.e. neither have the macro context (the
> surroundings of the macro call) any effect on its innards, nor the does the
> macro expansion alter the macro call's environment. So
> every identifier that is introduced in a macro template is (in a sense)
> anonymous.
> 
> That said, there is a special device for circumvening hygiene, which is a
> special macro pattern that is able to grab an identifier from the macro call's
> environment.
> 
> For more explanation look in DRM (Macro Hygiene)
> http://www.gwydiondylan.org/drm/drm_85.htm#HEADING85-0

Thanks. I am aware of hygiene, and I though that it included locals, but
when I read the DRM chapter I had trouble ferreting out this specific issue.
For some reason I only saw mention of module variables, and I could not find
a single example macro in the DRM that creates a local that is not visible
in the expansion body. Reading it again, I am surprised I didn't see the
answer to my question. And, of course, a quick flip of the pages immediately
revealed to me the "\|" macro on page 177, which uses a temporary local.

D'oh!

-- 
Chris Page
Mac OS Lead, Palm Desktop
Palm, Inc.

let mailto = concatenate( "page", "@", "best.com" );




References: