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 | |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | share/txr/stdlib/place.tl | 14 |
2 files changed, 14 insertions, 8 deletions
@@ -1,3 +1,11 @@ +2015-07-11 Kaz Kylheku <kaz@kylheku.com> + + * 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. + 2015-07-10 Kaz Kylheku <kaz@kylheku.com> * eval.c (eval_init): Register bindable as intrinsic. 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 |