source: project/wiki/eggref/5/begin-syntax @ 36801

Last change on this file since 36801 was 36801, checked in by evhan, 8 months ago

wiki/eggref: update docs/formatting/urls and eggref/5/{r7rs,fancypants,chicken-belt}

File size: 847 bytes
Line 
1[[tags: egg]]
2
3== begin-syntax
4
5[[toc:]]
6
7== Description
8
9This is a small extension that allows for inline macro operations.
10
11The source for this extension is available [[https://git.foldling.org/chicken-begin-syntax.git|here]].
12
13== Usage
14
15<syntax>(begin-syntax EXPR ...)</syntax>
16
17Evaluates its body and immediately inserts the final result into the program, as though by macro expansion.
18
19If the result is a macro transformer, it is immediately invoked with no arguments and the result is inserted into the program.
20
21This form can be thought of as a macro definition followed by its immediate expansion, for example:
22
23<enscript>
24(begin-syntax '(+ 1 2))
25
26; => (let-syntax ((a (er-macro-transformer
27;                     (lambda (_ _ _) '(+ 1 2)))))
28;      (a))
29</enscript>
30
31== Author
32
33[[/users/evan-hanson|Evan Hanson]]
34
35== License
36
373-Clause BSD
Note: See TracBrowser for help on using the repository browser.