This package contains functionality to pretty-print code. The code emitter
exports two functions: emit
and emit-list
. The emit
function takes as
input several strings that may have ~~a~ parameters. Each ~~a~ paramater in
the string should have a corresponding parameter. An example is:
(emit "void ~a(~a) {" funcname parameter
" ~a" statements
"}")
All statements in statements
will be indented properly.
The following example shows how the emit-list
function should be used:
(emit-list some-list)
(emit-list some-list :nr-lines 2)
(emit-list some-list :separator ", ")
The first function emits each element of list some-list
on a separate line,
indented as the indentation should be. The second example, does the same but
leaves a blank line in between. The third example emits a list without
newlines but with the separator “, ” in between.
In case something is wrong, it is necessary to reset the code-emitter:
(reset-code-emitter)
The source code has been provided as Org-mode files that also exports documentation.
The software is licensed under GPL version 3.
Pieter Hijma 2018