Meme printer: Clojure forms → Doc trees. Builds Wadler-Lindig Doc trees from Clojure forms, handling meme syntax (call notation, sugar, metadata, comments) and Clojure output mode. Delegates to render for Doc algebra and layout.
The printer is parameterized by a style map that controls layout policy
(head-line-args, definition-form spacing, pair grouping, binding layout).
Formatters own style: canon passes a full style, flat passes nil for
true pass-through. See to-doc for the public entry point.
Meme printer: Clojure forms → Doc trees. Builds Wadler-Lindig Doc trees from Clojure forms, handling meme syntax (call notation, sugar, metadata, comments) and Clojure output mode. Delegates to render for Doc algebra and layout. The printer is parameterized by a *style map* that controls layout policy (head-line-args, definition-form spacing, pair grouping, binding layout). Formatters own style: canon passes a full style, flat passes nil for true pass-through. See `to-doc` for the public entry point.
Default per-slot structural renderers, keyed by slot name (see
meme-lang.form-shape for the vocabulary). Each renderer is
(fn [value ctx] → Doc). Styles extend or override this map via
their :slot-renderers key; the printer merges overrides over these
defaults, so a style that overrides only one slot keeps the rest.
Default per-slot structural renderers, keyed by slot name (see `meme-lang.form-shape` for the vocabulary). Each renderer is `(fn [value ctx] → Doc)`. Styles extend or override this map via their `:slot-renderers` key; the printer merges overrides over these defaults, so a style that overrides only one slot keeps the rest.
(join-with-trailing-comments format-fn forms)Join formatted form strings with blank lines. Appends trailing comments from :trailing-ws metadata on the forms sequence.
Join formatted form strings with blank lines. Appends trailing comments from :trailing-ws metadata on the forms sequence.
(to-doc form)(to-doc form mode)(to-doc form mode style)(to-doc form mode style form-shape)Convert a Clojure form to a Doc tree, with comment attachment. Comments are always emitted — the hardline in comment-doc forces the enclosing group to break, so comments are never silently dropped.
mode :meme (default) or :clj. style layout policy map (nil = pass-through, no opinions). Keyed by semantic slot names, not form names. form-shape registry map (head-symbol → decomposer fn). When nil, no form is decomposed — every call renders as a plain body sequence. The lang owns this registry; formatters pass it in.
Formatters own style — see canon and flat formatter modules.
Convert a Clojure form to a Doc tree, with comment attachment.
Comments are always emitted — the hardline in comment-doc forces the
enclosing group to break, so comments are never silently dropped.
mode :meme (default) or :clj.
style layout policy map (nil = pass-through, no opinions).
Keyed by semantic slot names, not form names.
form-shape registry map (head-symbol → decomposer fn). When nil,
no form is decomposed — every call renders as a plain
body sequence. The lang owns this registry; formatters
pass it in.
Formatters own style — see canon and flat formatter modules.(validate-format-input forms)Guard format-forms input: reject nil, strings, maps, and sets.
Guard format-forms input: reject nil, strings, maps, and sets.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |