Using eval in a macro tends to indicate you are using the wrong tool for
the job. If you want to deal with an object (such as a function reference),
then use a function.

On Sat Jan 24 2015 at 3:15:43 AM Kirill Ignatiev <[email protected]>
wrote:

> On Saturday, 24 January 2015 02:22:20 UTC-5, Ivar Nesje wrote:
>>
>> No, using eval inside a macro is (almost) never what you want.
>>
>> A macro is a function that transform one expression to another
>> expression. You should return an expression that print the string version
>> of the input, not print directly in the macro.
>
>
> Well, the idea is that if I have a macro that gets passed either a
> function name, or an anonymous function, I only need to compute its name
> once, so I evaluate the expression, once, to find out what's there, and
> then later keep reusing the same string. If I know that the macro only ever
> gets functions passed to it (so no side-effects), that seems okay.
>

Reply via email to