Paste number 78107: none

Index of paste annotations: 1

Paste number 78107: none
Pasted by: none
When:1 year, 4 months ago
Share:Tweet this! | http://paste.lisp.org/+1O9N
Channel:None
Paste contents:
Raw Source | XML | Display As
; (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))

Annotations for this paste:

Annotation number 1: untitled
Pasted by: none
When:1 year, 4 months ago
Share:Tweet this! | http://paste.lisp.org/+1O9N/1
Paste contents:
Raw Source | Display As
(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))

Colorize as:
Show Line Numbers
Index of paste annotations: 1

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.