Last active
August 29, 2015 13:57
-
-
Save 1ambda/9510951 to your computer and use it in GitHub Desktop.
lisp macro example
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
CL-USER> (defun sample () | |
`#'(lambda () | |
(+ 3 5))) | |
CL-USER> (defmacro sample2 () | |
`#'(lambda () | |
(+ 3 5))) | |
CL-USER> (sample) | |
#'(LAMBDA () (+ 3 5)) | |
CL-USER> (sample2) | |
#<FUNCTION (LAMBDA ()) {259C50C5}> | |
CL-USER> (eval (sample)) | |
#<FUNCTION (LAMBDA ()) {259EF9C5}> | |
CL-USER> (funcall (eval (sample))) | |
8 | |
CL-USER> (funcall (sample2)) | |
8 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment