>>>>> "Craig" == Craig Lanning <CraigL(a)internetx.net> writes:
Craig> At 09:38 AM 8/26/98 +0200, Michael Sperber [Mr. Preprocessor] wrote:
>>>>>>> "Craig" == Craig Lanning <CraigL(a)internetx.net> writes:
>>
Craig> At 09:33 AM 8/25/98 +0200, Michael Sperber [Mr. Preprocessor] wrote:
>>>>>>>>> "Clemens" == Clemens Heitzinger <cheitzin(a)rainbow.studorg.tuwien.ac.at> writes:
>>>>
Clemens> What is "the right thing"?
>>>>
>>>> I'll say it once again: The right thing is that macros respect the
>>>> same scoping rules as the underlying language.
>>
Craig> Which time? Scoping rules get applied to CL macros twice, once when the
Craig> macro function is executed, and again when the result of the macro is
Craig> executed. (Let's remember, a macro is just a function that returns an
Craig> executable form as its value.)
>>
>> Well, the lexical environment of the macro definition only gets
>> applied to the *definition* of the macro. The lexical environment of
>> the *use* gets applied to its expansion. This is contrary to how
>> lexical scoping normally works, the body of a function (corresponding
>> to the body, i.e. expansion of a macro) is executed in the lexical
>> environment of its definition, not of its use.
Craig> That doesn't make any sense. The function aspect of the macro *IS* being
Craig> run within the lexical scope of its definition. The expansion of a macro
Craig> is *NOT* its body it is the return value.
Sorry about the confusion of terms. However, what you're saying is an
accurate analysis of the problem with CL's macro system. *Of course*
things don't make any sense in the context of the CL macro system,
which is precisely why CL macros (or their expansions) cannot
follow the scoping rules of the language.
--
Cheers =8-} Chipsy
Friede, Völkerverständigung und überhaupt blabla