diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-10-28 05:04:23 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-10-28 05:04:23 -0700 |
commit | d80d25d7bffd8e4dbf8a43870046bc256a12cd66 (patch) | |
tree | 16de75112d64de4a9715423e757614fd6b3f89d0 /txr.1 | |
parent | 58c1299e112e10bcb37ae888f3dbc6d3aa211eeb (diff) | |
download | txr-d80d25d7bffd8e4dbf8a43870046bc256a12cd66.tar.gz txr-d80d25d7bffd8e4dbf8a43870046bc256a12cd66.tar.bz2 txr-d80d25d7bffd8e4dbf8a43870046bc256a12cd66.zip |
Improvement in place macros.
Expansion of places now gives priority to place macros.
Moreover, it iterates over place macro and ordinary macro
expansion.
* share/txr/stdlib/place.tl (sys:trigger-load): Removed.
(sys:pl-expand): Rewritten.
* txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 28 |
1 files changed, 25 insertions, 3 deletions
@@ -24681,9 +24681,31 @@ has the same syntax as It specifies a macro transformation for a compound form which has the .meta name symbol in its leftmost position. -This macro expansion is applied when such a form is used as a place. -It is applied after all other expansions, and no other macro-expansions -are applied afterward. + +Forms which are used as syntactic places are subject to a modified +macro-expansion algorithm. If a place macro applies to a place, then it is +expanded, otherwise it is taken as-is. Then the place is expanded as a ordinary +macro (possibly a symbol macro). Then the process is repeated from the +beginning, as necessary. Thus, the output of the ordinary macro expansion may +potentially be, again, a place macro. Place macros can expand to other place +macros or ordinary macros and vice versa. + +Place macro expansion doesn't use an environment; place macros are in a single +global namespace, special to place macros. There are no lexically scoped place +macros. Such an effect can be achieved by having a place macro expand to +an a form which is the target of a global or local macro, as necessary. + +The +.code define-place-macro +form does not cause +.meta name +to become +.code fboundp +or +.codn boundp . + +There can exist both an ordinary macro and a place macro of the same name; +moreover, this is potentially useful. .TP* "Example:" |