diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2015-07-11 07:13:58 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2015-07-11 07:13:58 -0700 |
commit | 4ccc4bff6556940a1268d96ec60bb2f599f0fe6d (patch) | |
tree | 382349df3a99fc569ebb23b39419bf1cd817b885 /share | |
parent | 00a1e0c15d9a62d93b187a16052a9e6e3c46790a (diff) | |
download | txr-4ccc4bff6556940a1268d96ec60bb2f599f0fe6d.tar.gz txr-4ccc4bff6556940a1268d96ec60bb2f599f0fe6d.tar.bz2 txr-4ccc4bff6556940a1268d96ec60bb2f599f0fe6d.zip |
* share/txr/stdlib/place.tl (defplace dwim): Eliminate
ogetter-sym variable for caching the sequence; use the getter
for the sequence place to access it. Again, this is for placelet,
where the caching is visible. Another way to fix this is to
clobber the cache variable when updating the sequence place.
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/place.tl | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index af03070f..9cae3974 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -417,17 +417,16 @@ oldval-sym dflval-sym) (let ((sys:*lisp1* (or (symbolp obj-place) sys:*lisp1*))) (with-update-expander (ogetter-sym osetter-sym) obj-place nil - ^(rlet ((,obj-sym (,ogetter-sym)) - (,index-sym (sys:l1-val ,index)) + ^(rlet ((,index-sym (sys:l1-val ,index)) ,*(if have-default-p ^((,dflval-sym (sys:l1-val ,default))))) (macrolet ((,getter () - '[,obj-sym ,index-sym - ,*(if have-default-p ^(,dflval-sym))]) + '[(,ogetter-sym) ,index-sym + ,*(if have-default-p ^(,dflval-sym))]) (,setter (val) ^(rlet ((,',newval-sym ,val)) (,',osetter-sym - (sys:dwim-set ,',obj-sym + (sys:dwim-set (,',ogetter-sym) ,',index-sym ,',newval-sym)) ,',newval-sym))) ,body)))))) @@ -437,11 +436,10 @@ (let ((sys:*lisp1* (or (symbolp obj-place) sys:*lisp1*))) (with-update-expander (ogetter-sym osetter-sym) obj-place nil ^(macrolet ((,ssetter (val) - ^(rlet ((,',obj-sym (,',ogetter-sym)) - (,',index-sym (sys:l1-val ,',index)) + ^(rlet ((,',index-sym (sys:l1-val ,',index)) (,',newval-sym ,val)) (,',osetter-sym - (sys:dwim-set ,',obj-sym + (sys:dwim-set (,',ogetter-sym) ,*(if ,have-default-p ^((prog1 ,',index-sym |