summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-01-01 12:11:00 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-01-01 12:11:00 -0800
commitf9f8b1cc48212450fd200cc517b8f9ed932e1cb9 (patch)
tree84b3b2d801edf3416437c125647c0aa5479756af /txr.1
parent370a210171061ae9c116b37895923c6f20733a7b (diff)
downloadtxr-f9f8b1cc48212450fd200cc517b8f9ed932e1cb9.tar.gz
txr-f9f8b1cc48212450fd200cc517b8f9ed932e1cb9.tar.bz2
txr-f9f8b1cc48212450fd200cc517b8f9ed932e1cb9.zip
New macro: prog2
* eval.c (prog2_s): New symbol variable. (me_prog2): New macro expander function. (eval_init): Initialize prog2_s variable with interned symbol. Register prog2 macro expander. * txr.1: Maintain the documentation for progn and prog1, improving the wording and adding a dialect note . Document prog2.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.149
1 files changed, 45 insertions, 4 deletions
diff --git a/txr.1 b/txr.1
index 3ce278ac..c3aac32a 100644
--- a/txr.1
+++ b/txr.1
@@ -15085,16 +15085,20 @@ share any portion of the environment at any level of nesting.
.desc
The
.code progn
-operator evaluates forms in order, and returns the value
-of the last form. The return value of the form
+operator evaluates each
+.meta form
+in in left-to-right order, and returns the value
+of the last form. The value of the form
.code (progn)
is
.codn nil .
The
.code prog1
-operator evaluates forms in order, and returns the value
-of the first form. The return value of the form
+operator evaluates each
+.meta form
+in left-to-right order, and returns the value
+of the first form. The value of the form
.code (prog1)
is
.codn nil .
@@ -15106,6 +15110,43 @@ of a body of forms, the value of the last of which is returned.
These operators are said to feature an implicit
.codn progn .
+.TP* "Dialect Note:"
+In ANSI Common Lisp,
+.code prog1
+requires at least one argument.
+
+.coNP Macro @ prog2
+.synb
+.mets (prog2 << form *)
+.syne
+.desc
+The
+.code prog2
+evaluates each
+.meta form
+in left-to-right order. The value is that of the second form, if present,
+otherwise it is
+.codn nil .
+
+The form
+.code "(prog2 1 2 3)"
+yields
+.codn 2 .
+The value of
+.code "(prog2 1 2)"
+is also
+.codn 2 ;
+.code "(prog2 1)"
+and
+.code "(prog2)"
+yield
+.codn nil .
+
+.TP* "Dialect Note:"
+In ANSI Common Lisp,
+.code prog2
+requires at least two arguments.
+
.coNP Operator @ cond
.synb
.mets (cond >> {( test << form *)}*)