Package macro-level
Description
Simply (:import-from #:macro-level #:
from your defpackage. Don't macro-level
)(:use)
!
macro-level
is an embarrassingly trivial convenience macro
that saves on indentation while being more concise and direct.
(macro-level
...)
==
;; Canonical indentation. macro-level
saves 11 spaces.
(macrolet ((m ()
...))
(m))
==
;; "Miser" indentation. macro-level
saves 5 spaces.
(macrolet
((m ()
...))
(m))
When used as part of a macroexpansion, macro-level
also conveniently relieves the macro implementor from naming and using a gensym
for the one-shot macro when compared to writing out a macrolet
by hand, in addition to the other advantages.
Simply (:import-from #:macro-level #:
from your defpackage. Don't macro-level
)(:use)
!
&body body => results
Expands to `(macrolet ((,macro () ,@body)) (,macro))
where macro is a gensym.
Support could eventually be added to Slime so that interactive macroexpansion of macro-level
calls with C-c C-m (slime-expand-1
)
would show the same expansion as interactively macroexpanding (m ...)
after (defmacro m () ...)
, assuming the lexical context is not important.