RFC -- HYGIENIC MACROS IN PYTHON

Justin Sheehy justin at iago.org
Wed Feb 6 09:56:46 EST 2002


philh at comuno.freeserve.co.uk (phil hunt) writes:

> And what if I decide that for my particular application, that's just
> the behaviour I want?

I wonder why your reaction is so strong here.

Mr. Kraska has clearly stated that this is an experiment.  It certainly
isn't something that is about to be shoved down anyone's throat.  If
your particular application doesn't want to behave as he describes,
just don't get involved with the experiment.

As an aside: while many people think that purely hygienic macros are
lacking in an important sort of power, they are a well-researched
topic and not a bad place to start if implementing a macro system from
scratch for experimentation purposes.

> Or do you think that you know better than all the users of your
> macro system, even though you've not met them and don't know
> anything about the software they are writing?

At this point, he does know that, since he is presumably the only user.

What is the problem here?

>>>   do:
>>>      dosomething()
>>>      while i <10                                                                                        
>>
>>Correct. I'm not quite sure how to handle that one.
>
> It doesn't need handling; python does it OK already.

Many people have asked for a loop-and-a-half construct before.  This
looks like it could be a simple expression of that concept.  I
personally don't want to use it, but that doesn't mean it is worthless.

>>But of course macros themselves significantly erode simplicity, making
>>them _per se_ unpythonic, wouldn't you say? :)

> Any dogmatic pronouncement that a particular programming technique (such as
> macros) is inherently good or bad is just plain brain dead.

I saw no such claim of goodness or badness.  A claim was made
about whether macros are Pythonic, and it seemed to be a justified one.

-Justin

 






More information about the Python-list mailing list