I have just begun to learn about macros, and it would be really helpful if I could see what the expanded form of a specific macro looks like.
( using Lispworks)
( using Lispworks)
Discuss and learn Lisp programming of all dialects
This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.
5 posts · 4823 views
(defmacro mac (form)
`(pprint (macroexpand-1 ',form)))
The reason it's a macro is so that you don't have to quote the code you copy in (like you have to with macroexpand and macroexpand-1). Used like so:
(mac (setf (car hi) 5))
which in Corman Lisp would output:
(COMMON-LISP::%RPLACA HI 5)