|
1 | 1 | Title: Adding Macros to uLisp
|
2 | 2 |
|
3 |
| -The Lisp form `:::list defmacro` allows for more powerful syntactic constructs. |
| 3 | +The Lisp form `:::list defmacro` allows for more powerful syntactic constructs. Note that this does not include backquote support -- there is a [separate page]({filename}backquote.md) for that. |
| 4 | + |
| 5 | +*EDIT: In response to [all of the confusion](http://forum.ulisp.com/t/what-would-you-like-to-see-in-ulisp-in-2024/1350/36) I seem to have caused by posting this error-ridden guide, I have done my best to correct all of the errors. Hopefully, now it should be possible to to directly follow this guide from a vanilla uLisp to be able to add macros. I apologize for any confusion, compiler problems, and crashes caused by my sloppiness.* |
4 | 6 |
|
5 | 7 | ## Part 1 - the Functions
|
6 | 8 |
|
@@ -72,10 +74,10 @@ The Lisp form `:::list defmacro` allows for more powerful syntactic constructs.
|
72 | 74 | ```
|
73 | 75 |
|
74 | 76 | ```cpp
|
75 |
| - { stringmacro, NULL, MINMAX(OTHER_FORMS, 1, UNLIMITED), docmacro }, |
76 |
| - { stringdefmacro, sp_defmacro, MINMAX(SPECIAL_FORMS, 2, UNLIMITED), docdefmacro }, |
77 |
| - { stringmacroexpand1, fn_macroexpand1, MINMAX(FUNCTIONS, 1, 1), docmacroexpand1 }, |
78 |
| - { stringmacroexpand, fn_macroexpand, MINMAX(FUNCTIONS, 1, 1), docmacroexpand }, |
| 77 | + { stringmacro, NULL, 0017, docmacro }, |
| 78 | + { stringdefmacro, sp_defmacro, 0327, docdefmacro }, |
| 79 | + { stringmacroexpand1, fn_macroexpand1, 0111, docmacroexpand1 }, |
| 80 | + { stringmacroexpand, fn_macroexpand, 0111, docmacroexpand }, |
79 | 81 | ```
|
80 | 82 |
|
81 | 83 | 2. Wire up the evaluator to expand the macros:
|
|
0 commit comments