; (the-op 3 - 2 - 4)
; ==> -3
(defmacro the-op (&body body)
`(if ',body (op ,@(reverse body))))
(defmacro op (x &optional y &rest z)
`(if ,y (if ',z (op (,y (op ,@z) ,x)) (,y ,x)) ,x))
(defmacro the-op (&body body)
`(if ',body (op ,@(reverse body))))
(defmacro op (x &optional y &rest z)
(with-gensyms (a b c)
`(let ((,a ,x)
(,b ,y)
(,c ',z))
(if ,b (if ',z (op (,b (op ,@c) ,a)) (,b ,a)) ,a))))
;; from practical common lisp
(defmacro with-gensyms ((&rest names) &body body)
`(let ,(loop for n in names collect `(,n (gensym)))
,@body))