From 95abf5aa1cb792bdcb472399d1ef9dfc9b9088e0 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 25 Oct 2016 13:09:30 -0700 Subject: nthcdr place bugfix: wrong return value. * share/txr/stdlib/place.tl (defplace nthcdr): In the case when list is a place, the setter operation returns the wrong value: the entire list, rather than the value assigned. --- share/txr/stdlib/place.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/txr/stdlib/place.tl b/share/txr/stdlib/place.tl index acb17886..198dbb19 100644 --- a/share/txr/stdlib/place.tl +++ b/share/txr/stdlib/place.tl @@ -467,7 +467,7 @@ (,parent-cell-sym (nthcdr ,index-sym ,sentinel-head-sym))) (macrolet ((,getter () ^(cdr ,',parent-cell-sym)) (,setter (val) - ^(progn (sys:rplacd ,',parent-cell-sym ,val) + ^(prog1 (sys:rplacd ,',parent-cell-sym ,val) (,',lsetter (cdr ,',sentinel-head-sym))))) ,body)))) ^(alet ((,index-sym ,index) -- cgit v1.2.3