summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-03-12 23:01:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-03-12 23:01:30 -0700
commit2e99d6d842d4714a2b165b1ae3920013467e03f7 (patch)
treea149e58f25a7d8dccf0e20a11e2c44cbde34c57d /txr.1
parente39f3fcc0520ce0d93082a8b8e87187eb38efd48 (diff)
downloadtxr-2e99d6d842d4714a2b165b1ae3920013467e03f7.tar.gz
txr-2e99d6d842d4714a2b165b1ae3920013467e03f7.tar.bz2
txr-2e99d6d842d4714a2b165b1ae3920013467e03f7.zip
New directive: mdo.
* eval.h (progn_s): Declarationa added. * match.c (mdo_s): New symbol variable. (syms_init): Initialize mdo_s. * match.h (mdo_s): Declared. * parser.y (check_for_include): Renamed to check_parse_time_action and implements mdo, not only include. (clauses_rev): Follow rename of function. * txr.1: Documented.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.154
1 files changed, 51 insertions, 3 deletions
diff --git a/txr.1 b/txr.1
index d9ef1e36..50bb99c2 100644
--- a/txr.1
+++ b/txr.1
@@ -3263,9 +3263,19 @@ These directives allow \*(TX programs to be modularized. They bring in
code from a file, in two different ways.
.coIP @(do)
-The do directive is used to evaluate \*(TL expressions, discarding their
+The
+.code do
+directive is used to evaluate \*(TL expressions, discarding their
result values. See the TXR LISP section far below.
+.coIP @(mdo)
+The
+.code mdo
+(macro
+.codn do )
+directive evaluates \*(TL expressions immediately, during the parsing
+of the \*(TX syntax in which it occurs.
+
.PP
.SS* Subexpression Evaluation
@@ -6508,10 +6518,12 @@ The syntax of
is:
.cblk
-.mets @(do << lisp-expression )
+.mets @(do << lisp-expression *)
.cble
-The do directive evaluates a \*(TL expression. (See TXR LISP far
+The
+.code do
+directive evaluates zero or more \*(TL expressions. (See TXR LISP far
below.) The value of the expression is ignored, and matching continues
continues with the directives which follow the
.code do
@@ -6532,6 +6544,42 @@ Example:
@(do (set [h a] b))
.cble
+.dir mdo
+
+The syntax of
+.code @(mdo)
+is:
+
+.cblk
+.mets @(mdo << lisp-expression *)
+.cble
+
+Like the
+.code do
+directive,
+.code mdo
+(macro-time
+.codn do )
+evaluates zero or more \*(TL expressions. Unlike
+.codn do ,
+.code mdo
+performs this evaluation immediately upon being parsed.
+Then it disappears from the syntax.
+
+The effect of
+.code "@(mdo e0 e1 e2 ...)"
+is exactly like
+.code "@(do (macro-time e0 e1 e2 ...))"
+except that
+.code do
+doesn't disappear from the syntax.
+
+Another difference is that
+.code do
+can be used as a horizontal or vertical directive, whereas
+.code mdo
+is only vertical.
+
.SS* Blocks
.NP* Overview