3 ms·
The point was that macros are not special, they don't give you anything more for "self-modification".
by Tomte 4y ago
The point was that macros are not special, they don't give you anything more for "self-modification".
- eduction 4y agoMacros are special in the sense that they are expressly intended to modify code. I take your implied point that at runtime there is not really a difference between a function designed to rewrite code data structures and evaluate them vs calling macroexpand and using a predefined macro. But it’s going to be more concise at least to do the latter. It’s also probably the case that when people talk about lisp macros they are including facilities that can be used anywhere but are mainly used for macros - backtick quoting, unquoting forms, etc. - as well as macro like activities like having a function designed to rewrite a code data structure at runtime prior to it going to eval (even if defined with defn or defun rather than defmacro).
- lispm 4y ago> Macros are special in the sense that they are expressly intended to modify code Macros are intended to transform code. They are designed such that in compiled code the transformation is only done at compile time.