summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-14 06:58:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-14 06:58:53 -0700
commitd00bd46c2f65124d5612c20cad0009293f536894 (patch)
tree81b3318bedc497eedcf2834aa0a5048c7be987f7
parent47721f71762f5deed5d39123e7438a3b69cf45fc (diff)
downloadtxr-d00bd46c2f65124d5612c20cad0009293f536894.tar.gz
txr-d00bd46c2f65124d5612c20cad0009293f536894.tar.bz2
txr-d00bd46c2f65124d5612c20cad0009293f536894.zip
push can safely use alet rather than rlet.
push doesn't unconditionally require a temporary location for operational correctness; a temporary is used only for evaluation order. Therefore it is safe to use alet to eliminate the temporary when (after all expansion) the item is a trivial symbolic expression. * share/txr/stdlib/place.tl (push): Use alet to bind the temp which holds the new item.
-rw-r--r--share/txr/stdlib/place.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl
index 8f7f4aa1..5168b22c 100644
--- a/share/txr/stdlib/place.tl
+++ b/share/txr/stdlib/place.tl
@@ -271,7 +271,7 @@
(defmacro push (new-item place :env env)
(with-gensyms (new-sym)
- ^(rlet ((,new-sym ,new-item))
+ ^(alet ((,new-sym ,new-item))
,(with-update-expander (getter setter) place env
^(,setter (cons ,new-sym (,getter)))))))