RFC -- HYGIENIC MACROS IN PYTHON

phil hunt philh at comuno.freeserve.co.uk
Wed Feb 6 17:56:48 CET 2002


On 06 Feb 2002 10:37:31 -0500, Christopher Barber <cbarber at curl.com> wrote:
>philh at comuno.freeserve.co.uk (phil hunt) writes:
>
>> On Wed, 06 Feb 2002 00:04:24 GMT, Courageous <jkraska at san.rr.com> wrote:
>> >
>> >>What if a macro needs to create local variables in its expansion?
>> >
>> >This is perfectly legitimate. What's not legitimate is...
>> >
>> >	deflingo myterm (i, codeblock):
>> >		j=3
>> >
>> >...where j=3 modifies the variable "j" in the context of the caller
>> >if this variable is preexisting in the caller. That's non hygienic
>> >behavior. Past experience with macros has shown this to be bad
>> >behavior; hence there is a design in the community for good "hygiene,"
>> >as it were.
>> 
>> And what if I decide that for my particular application, that's just
>> the behaviour I want? 
>
>There is no reason that the macro system cannot provide a means to create
>"unhygienic" references, but you would not want that to be the default.

That seems to me to be an entirely sensible position.

-- 
===== Philip Hunt ===== philh at comuno.freeserve.co.uk =====
Herbivore, a zero-effort email encryption system. Details at:
<http://www.vision25.demon.co.uk/oss/herbivore/intro.html>






More information about the Python-list mailing list