summaryrefslogtreecommitdiffstats
path: root/txr.1
diff options
context:
space:
mode:
Diffstat (limited to 'txr.1')
-rw-r--r--txr.148
1 files changed, 48 insertions, 0 deletions
diff --git a/txr.1 b/txr.1
index dde521b6..5bf7b6a8 100644
--- a/txr.1
+++ b/txr.1
@@ -14384,6 +14384,19 @@ value into
and returns
.codn t .
+.meIP (ensure < place << init-expr )
+If the place is
+.codn nil ,
+evaluates
+.codn init-expr ,
+stores that value into
+.meta place
+and returns it.
+Otherwise, returns the value of
+.meta place
+without changing its value or evaluating
+.codn init-expr .
+
.meIP (inc < place <> [ delta ])
Increments
.meta place
@@ -42858,6 +42871,41 @@ expression, stores the resulting value into
and returns
.codn t .
+.coNP Macro @ ensure
+.synb
+.mets (ensure < place << init-expr )
+.syne
+.desc
+The
+.code ensure
+macro examines the value of
+.metn place .
+
+If the current value is
+.codn nil ,
+then
+.meta init-expr
+is evaluated. The value is stored in
+.meta place
+and becomes the result of the
+.code ensure
+form.
+
+If the value of
+.meta place
+is other than
+.codn nil ,
+then the form yields that value.
+In this case,
+.meta init-expr
+isn't evaluated, and
+.meta place
+isn't modified.
+
+The
+.meta place
+expression is evaluated only once to determine the place.
+
.coNP Macros @ inc and @ dec
.synb
.mets (inc < place <> [ delta ])