summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.124
1 files changed, 23 insertions, 1 deletions
diff --git a/txr.1 b/txr.1
index 905e29ad..f84455bf 100644
--- a/txr.1
+++ b/txr.1
@@ -10235,7 +10235,7 @@ construct is erroneous.
The meta-symbol @rest indicates that any trailing arguments to the
function are to be inserted there. If the form does not contain
-any @<num> syntax or @<rest> syntax, then @<rest> is implicitly
+any @<num> syntax or @rest syntax, then @rest is implicitly
inserted. What this means is that, for example, since the form (op foo) does
not contain any numeric positional arguments like @1, and does not contain
@rest, it is actually a shorthand for (op foo . @rest).
@@ -10287,6 +10287,28 @@ Examples:
(mapcar (op list @2 @1) '((1 2) (a b))) -> ((2 1) (b a))
+.TP
+Nested op:
+
+The op and do operators can be nested. This raises the question: if a
+metanumber like @1 or @rest occurs in an op that is nested within an op,
+what is the meaning?
+
+A metanumber always belongs with the inner-most op or do operator. So for
+instance (op (op @1)) means that an (op @1) expression is nested
+within an op expression. The @1 belongs with the inner op.
+
+There is a way to refer to an outer op metanumber argument, we need to
+add a meta for every level of escape. For example in (op (op @@1))
+the @@1 belongs to the outer op: it is the same as @1. That is to say,
+in the expression (op @1 (op @@1)), the @1 and @@1 are the same thing:
+parameter 1 of the lambda function generated by the outer op.
+In the expression (op @1 (op @1)) there are two different parameters:
+the first @1 is argument of the outer function, and the second @1
+is the first argument of the inner function. Of course, if there
+are three levels of nesting, then three metas are needed to insert
+a parameter from the outermost op, into the innermost op.
+
.SS Function chain
.TP