|Project author||Jean-Philippe Paradis|
|Programming language||Common Lisp|
|Library type||Visual macro|
|Project complexity||Embarrassingly trivial|
|Date||4 oct 2012|
(Oct 2012 dist and later)
|⬉||Depends on||Depended on by|
macro-level is an embarrassingly trivial convenience macro that saves on indentation while being more concise and direct.
macro-level...) == ;; Canonical indentation.
macro-levelsaves 11 spaces. (macrolet ((m () ...)) (m)) == ;; "Miser" indentation.
macro-levelsaves 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.
macro-level, simply (
macro-level:macro-level ...) after loading the ASDF system, as this macro is not used that often and the length won't have any effect on the indentation:
macro-level:macro-level...) ;; VS (
(:import-from #:macro-level #:macro-level) in your
defpackage if you prefer the latter form. Don't
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.