3 ms·
We could start by tinkering with a silly macro: [10]> (defmacro rev (&rest forms) `(progn ,@(mapcar (lambda (form) (if (and (co
by kazinator 9y ago
We could start by tinkering with a silly macro:
[10]> (defmacro rev (&rest forms)
`(progn ,@(mapcar (lambda (form)
(if (and (consp form) (rest form))
`(,(car (last form)) ,@(butlast form))
form))
forms)))
REV
[11]> (rev (1 1 +))
2
[12]> (rev (3 print) (1 1 +))
3
2