Skip to content

Instantly share code, notes, and snippets.

@agumonkey
Created March 7, 2019 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agumonkey/de5d9fb8b4d25f6979fdcd680a945171 to your computer and use it in GitHub Desktop.
Save agumonkey/de5d9fb8b4d25f6979fdcd680a945171 to your computer and use it in GitHub Desktop.
(defmacro progm (body)
(if (null body)
'()
`(cons ,(car body)
(progm ,(cdr body)))))
(defmacro progb (&rest pair)
(let ((a (car pair))
(b (cadr pair)))
`(cons ,a (cons ,b nil))))
(progb
(+ 1 2)
(+ 1 2 3)
(+ 1 2 3 4))
(defmacro progm (&rest body)
(let ((h (car body)))
(if (null h)
'()
`(cons ,h (progm ,@(cdr body))))))
(progm (+ 12 3 4)
(+ 0 1 0)
(list 1 2 3)
(message "foo"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment