3 ms·
Lisp macros receive as input valid s-expressions, that don't need necessarily to be valid common lisp code, such as (my-macro (2 + 2)) and output valid li
by kroger 13y ago
Lisp macros receive as input valid s-expressions, that don't need necessarily to be valid common lisp code, such as
(my-macro (2 + 2))
and output valid lisp code during macro expansion time. The macro my-macro could expand the code to something like:
(+ 2 2)
Some Lisp compilers such as CMUCL will issue a warning if you try to use wrong type (it has type inference), such as in this simple example:
(defmacro foo ()
`(+ 1 "foo"))
(defun bar ()
(foo))
You can see the compiler notes here: http://imgur.com/3vlQm6G http://imgur.com/3vlQm6G