diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-07-22 07:43:33 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-07-22 07:43:33 -0700 |
commit | 183e90ee84334efe3f27ddaa21ea5bb0355dc15d (patch) | |
tree | 8905856ce6569bd6284fec40ed60452167c1ec5a /txr.1 | |
parent | 420a230dbae897ee32c03297f7e4bb18f683a8b1 (diff) | |
download | txr-183e90ee84334efe3f27ddaa21ea5bb0355dc15d.tar.gz txr-183e90ee84334efe3f27ddaa21ea5bb0355dc15d.tar.bz2 txr-183e90ee84334efe3f27ddaa21ea5bb0355dc15d.zip |
Improve bad argument diagnosis for place macros.
* eval.c (op_mac_param_bind): New static function.
(eval_init): Register mac-param-bind operator.
* share/txr/stdlib/place.tl (define-place-macro): Use
mac-param-bind inside a lambda instead of tb macro.
* txr.1: Document mac-param-bind.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -29003,9 +29003,10 @@ Rather it may be substituted by one kind of form when it is treated as a pure value, and another kind of form when it is treated as a place. -.coNP Operator @ tree-bind +.coNP Operators @ tree-bind and @ mac-param-bind .synb .mets (tree-bind < macro-style-params < expr << form *) +.mets (mac-param-bind < context-expr < macro-style-params < expr << form *) .syne .desc The @@ -29031,6 +29032,22 @@ structural mismatch between the parameters and the value of One way to avoid this exception is to use .codn tree-case . +The +.code mac-param-bind +operator is similar to +.code tree-bind +except that it takes an extra argument, +.metn context-expr. +This argument is an expression which is evaluated. It is expected to +evaluate to a compound form. If an error occurs during binding, the error +diagnostic message is based on information obtained from this form. +By contrast, the +.code tree-bind +operator's error diagnostic refers to the +.code tree-bind +form, which is cryptic if the binding is used for the implementation +of some other construct, hidden from the user of that construct. + .coNP Operator @ tree-case .synb .mets (tree-case < expr >> {( macro-style-params << form *)}*) |