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
commitab4ae665f48656f9d2f0fc5d32197097f1624a70 (patch)
tree81b3318bedc497eedcf2834aa0a5048c7be987f7
parent05c527ed6e36992f69dc8fb073ee6b6899182d2f (diff)
downloadtxr-ab4ae665f48656f9d2f0fc5d32197097f1624a70.tar.gz
txr-ab4ae665f48656f9d2f0fc5d32197097f1624a70.tar.bz2
txr-ab4ae665f48656f9d2f0fc5d32197097f1624a70.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)))))))