diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-09-21 06:42:10 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-09-21 06:42:10 -0700 |
commit | 5faabad60b69d277cd37937361dbd4525721f6a2 (patch) | |
tree | 6059a13a21c13c675680ace2ca6cb6d03c6425f1 /share | |
parent | ec48df3cd8f6d561c5fa919dc5a3ffee25876401 (diff) | |
download | txr-5faabad60b69d277cd37937361dbd4525721f6a2.tar.gz txr-5faabad60b69d277cd37937361dbd4525721f6a2.tar.bz2 txr-5faabad60b69d277cd37937361dbd4525721f6a2.zip |
Use rlet in a few place macros for better code.
* share/txr/stdlib/place.tl (pset, push, pushnew): Use rlet
for binding the assigned or pushed value to a temporary,
so the temporary can disappear if the value is a constant.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/place.tl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index 61654509..49da5653 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -225,7 +225,7 @@ pvtgs '(nil nil))) (lets (first ls)) (stores (second ls)) - (body-form ^(let (,*lets) ,*stores))) + (body-form ^(rlet (,*lets) ,*stores))) (reduce-left (tb (accum-form (place value temp getter setter)) (call-update-expander getter setter place env accum-form)) @@ -287,7 +287,7 @@ (defmacro push (new-item place :env env) (with-gensyms (new-sym) - ^(let ((,new-sym ,new-item)) + ^(rlet ((,new-sym ,new-item)) ,(with-update-expander (getter setter) place env ^(,setter (cons ,new-sym (,getter))))))) @@ -302,7 +302,7 @@ (keyfun :)) (with-update-expander (getter setter) place env (with-gensyms (new-item-sym old-list-sym) - ^(let ((,new-item-sym ,new-item)) + ^(rlet ((,new-item-sym ,new-item)) ,(with-update-expander (getter setter) place env ^(let ((,old-list-sym (,getter))) (if (member ,new-item-sym ,old-list-sym ,testfun ,keyfun) |