chickadee » begin-syntax



This is a small extension that allows for inline macro operations.

The source for this extension is available here.


(begin-syntax EXPR ...) syntax

Evaluates its body and immediately inserts the final result into the program, as though by macro expansion.

If the result is a macro transformer, then this is immediately invoked with no arguments and the result is inserted into the program. Note that in this case the final expression of the begin-syntax body will be evaluated twice.

This form can be thought of as a macro definition followed by its immediate expansion, for example:

(begin-syntax '(+ 1 2))

; => (let-syntax ((a (er-macro-transformer
;                     (lambda (_ _ _) '(+ 1 2)))))
;      (a))


Evan Hanson


Copyright (c) 2016, 3-Clause BSD

Contents »