diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-11-19 10:56:40 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-11-19 11:07:05 -0800 |
commit | fe8c0def43c5248e00278cf8c05a1cf9bbc6b688 (patch) | |
tree | 1f10908810a6cb678369c36770a28a8d8a179ee3 /txr.1 | |
parent | 91de0e52b8d1cfa3d7d6e2be69d6d7cf6e479bfe (diff) | |
download | txr-fe8c0def43c5248e00278cf8c05a1cf9bbc6b688.tar.gz txr-fe8c0def43c5248e00278cf8c05a1cf9bbc6b688.tar.bz2 txr-fe8c0def43c5248e00278cf8c05a1cf9bbc6b688.zip |
Handle interpreted macros through function.
All macros are function bindings now.
* eval.c (me_interp_macro): New function. Body is
a copy of block from expand_macro.
(op_defmacro): Hoist the me_interp_macro function into
the object domain, installing the macro material as the
environment. This function is the expander.
(expand_macro): Assume that the binding is a function
and call it. The cons case is gone.
(expand_macrolet): Similar change to the one in
op_defmacro: a macrolet is also a function.
* txr.1: Documentation under symbol-macro updated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 30 |
1 files changed, 21 insertions, 9 deletions
@@ -14873,15 +14873,7 @@ The .code symbol-macro function retrieves the value of the global macro binding of .meta symbol -if it has one. The value of a macro binding isn't a function object, but a -list of the following form: - -.cblk -.mets (#<environment object> < macro-parameter-list << body-form *) -.cble - -This representation is likely to change or expand to include other -forms in future \*(TX versions. +if it has one. Note: the name of this function has nothing to do with symbol macros; it is named for consistency with @@ -14890,6 +14882,26 @@ and .codn symbol-value , referring to the "macro-expander binding of the symbol cell". +The value of a macro binding is a function object. +Intrinsic macros are C functions in the \*(TX kernel, which receive +the entire macro call form and macro environment, performing their +own destructuring. Currently, macros written in \*(TL are represented +as curried C functions which carry the following list object in their +environment cell: + +.cblk +.mets (#<environment object> < macro-parameter-list << body-form *) +.cble + +Local macros created by +.code macrolet +have +.code nil +in place of the environment object. + +This representation is likely to change or expand to include other +forms in future \*(TX versions. + The .code symbol-value function retrieves the value stored in the dynamic binding of |