Created
March 7, 2019 13:40
-
-
Save agumonkey/de5d9fb8b4d25f6979fdcd680a945171 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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