License: Public Domain , Load it with Quicklisp: (ql:quickload "macro-level")
Library type: Visual macro , Project complexity: Embarrassingly trivial

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))

Overview

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.

Dictionary

Dictionary » macro-level

Package macro-level

Description

Simply (:import-from #:macro-level #:macro-level) from your defpackage. Don't (:use)!

Macro macro-level

&body body => results

Arguments and Values

Description

Expands to `(macrolet ((,macro () ,@body)) (,macro)) where macro is a gensym.

Future work

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.