4 ms·
It could theoretically be a graph. For example I can make a circular list being a part of the source and the macro may process it. Get the first two items fro
by lispm 2y ago
It could theoretically be a graph.
For example I can make a circular list being a part of the source and the macro may process it.
Get the first two items from a list and add them:
CL-USER 21 > (defmacro add-2 (a)
(list '+ (first a) (second a)))
ADD-2
Now we construct a circular list and use the macro:
CL-USER 22 > (add-2 #1=(1 2 3 . #1#))
3
The circular list is really a part of the source code:
CL-USER 23 > '(add-2 #1=(1 2 3 . #1#))
(ADD-2 #1=(1 2 3 . #1#))
Another example: One could pass in a string and have the macro parse the string...