Created
February 23, 2014 02:29
-
-
Save cades/9165799 to your computer and use it in GitHub Desktop.
Solution to lisp-koan's final koan of macros.lsp
This file contains hidden or 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 log-form-with-value (&body body) | |
"records the body form, and the form's return value | |
to the list *log-with-value* and then evalues the body normally" | |
`(let ((logform nil) | |
(retval ,@body)) | |
;; 有沒有不需要list的解法? 試不出來QQ | |
(push (list :form ',@body :value retval) *log-with-value*) | |
retval)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment