From 7c68bc3f17cd3d595241d5dc42d27e8cc8a90c59 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Sep 2019 20:00:16 -0700 Subject: list-builder: simplify circularity check in pend. * share/txr/stdlib/build.tl (list-builder pend): Use tailp instead of last and eq. --- share/txr/stdlib/build.tl | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/share/txr/stdlib/build.tl b/share/txr/stdlib/build.tl index c607571f..76be9f55 100644 --- a/share/txr/stdlib/build.tl +++ b/share/txr/stdlib/build.tl @@ -49,10 +49,7 @@ (let ((st self.tail)) (rplacd st (append (cdr st) nil))) (let* ((tl (last self.tail)) - (cp (let ((ll (car (last lists)))) - (if (consp ll) - (let ((lt (last ll))) - (eq tl lt))))) + (cp (tailp tl (car (last lists)))) (nl [apply append lists])) (usr:rplacd tl (append (cdr tl) (if cp (copy-list nl) nl))) (set self.tail tl)) -- cgit v1.2.3