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.
