summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/ifa.tl2
-rw-r--r--txr.18
2 files changed, 8 insertions, 2 deletions
diff --git a/stdlib/ifa.tl b/stdlib/ifa.tl
index eaab6f3a..317ef9e7 100644
--- a/stdlib/ifa.tl
+++ b/stdlib/ifa.tl
@@ -54,7 +54,7 @@
(let* ((btemps (mapcar (ret (gensym)) before-it))
(atemps (mapcar (ret (gensym)) after-it)))
^(let (,*(zip btemps before-it))
- (placelet ((it ,it-form))
+ (placelet ((it (read-once ,it-form)))
(let (,*(zip atemps after-it))
(if (,sym ,*(if (eq 'dwim sym) ^(,(second test)))
,*btemps it ,*atemps)
diff --git a/txr.1 b/txr.1
index 66df2a59..e41b36ff 100644
--- a/txr.1
+++ b/txr.1
@@ -16915,7 +16915,13 @@ alias is used multiple times in the
.meta then
or
.meta else
-expressions. Otherwise, if the form is not a syntactic place
+expressions. Furthermore, the place form is implicitly surrounded with
+.code read-once
+so that the place's value is accessed only once, and multiple references to
+.code it
+refer to a copy of the value cached in a hidden variable, rather than
+generating multiple accesses to the place.
+Otherwise, if the form is not a syntactic place
.code it
is bound as an ordinary lexical variable to
the form's value.