summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-03-21 23:24:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-03-22 11:52:56 -0700
commit654a913f119664bce805fb2da94bcee0349ab7fb (patch)
treeda63867f8ec40ab0818851139b2491841027baf4 /txr.1
parent3e17fb079dcecebded6e7d8c834b918d9a3b541a (diff)
downloadtxr-654a913f119664bce805fb2da94bcee0349ab7fb.tar.gz
txr-654a913f119664bce805fb2da94bcee0349ab7fb.tar.bz2
txr-654a913f119664bce805fb2da94bcee0349ab7fb.zip
* eval.c (me_when): New static function.
(eval_init): Register "when" macro. * txr.1: Documented when macro.
Diffstat (limited to 'txr.1')
-rw-r--r--txr.115
1 files changed, 15 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index 4dbc7dbe..0849ad05 100644
--- a/txr.1
+++ b/txr.1
@@ -5580,6 +5580,21 @@ If the first form of a group yields nil, then processing continues with the
next group, if any. If all form groups yield nil, then the cond form yields
nil. This holds in the case that the syntax is empty: (cond) yields nil.
+.SS Macro when
+
+.TP
+Syntax:
+
+ (when <expression> {<form>}*)
+
+.TP
+Description:
+
+The when macro operator evaluates <expression>. If <expression> yields
+true, and there are additiona forms, then each <form> is evaluated.
+The value of the last form is becomes the result value of the when form.
+If there are no forms, then the result is nil.
+
.SS Operator/function if
.TP