Next: iklib expander etv, Previous: iklib expander extended export, Up: iklib expander [Index]
Fluid syntaxes are macro bindings that can be temporarily redefined while expanding a sequence of forms:
(import (vicare)) (define-fluid-syntax ciao (identifier-syntax "ciao")) ciao ⇒ "ciao" (fluid-let-syntax ((ciao (identifier-syntax "hello"))) ciao) ⇒ "hello" (fluid-let-syntax ((ciao (identifier-syntax "ohayo"))) ciao) ⇒ "ohayo" ciao ⇒ "ciao"
Like define-syntax
define a new syntax binding the transformer to
?keyword, but mark ?keyword as fluid so that later it can be
rebound by fluid-let-syntax
.
Similar, but not equal, to let-syntax
; rather than defining new
?keyword bindings, temporarily rebind the keywords to new
transformers while expanding the ?body forms. The given
?keyword must be already bound to fluid syntaxes defined by
define-fluid-syntax
.
There are two differences between fluid-let-syntax
and
let-syntax
: fluid-let-syntax
must appear in expression
context only; the internal ?body forms are not spliced in
the enclosing body.