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

Last change on this file since 36445 was 36445, checked in by evhan, 13 months ago

wiki/eggref/5: Add docs for recently ported eggs

File size: 871 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 [[http://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
37Copyright (c) 2016-2018, 3-Clause BSD
Note: See TracBrowser for help on using the repository browser.