4 ms·
A normal function call evaluates the arguments and then calls the function. Because macro expansion does something before evaluating the arguments, you can say
by hibbelig 8y ago
A normal function call evaluates the arguments and then calls the function.
Because macro expansion does something before evaluating the arguments, you can say that evaluating the arguments has been delayed.
I feel this is just looking at the same thing from two different directions.
Of course, macro expansion does _more_ than just delaying the evaluation of the arguments, and if people say that macros delay evaluating the arguments, you might think that's all they do.
- sparkie 8y agoA macro or FEXPR may never evaluate an operand at all. They simply receive the unevaluated forms and decide what to do with them, with explicit evaluation being just one option which can be performed on the operand. Delayed (lazy) evaluation merely prevents an operand being evaluated at the time of call and until you want to read its reduced value, after which it is automatically evaluated.
- lispm 8y ago> Because macro expansion does something before evaluating the arguments It does something independent of evaluation. When the code gets compiled, the macroexpander already has transformed the code. The code might never be evaluated in this Lisp. It might be written to disk and later be loaded into another Lisp. If something does not get evaluated, gets evaluated later, gets always evaluated or never -> that depends on the generated code. Thus 'delaying' something is the wrong idea and it limits the imagination of what macros are used for. Think of 'general code transformation', often independent of execution in a compilation phase.