X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcode%2Flist.lisp;h=2353c5a8f4fb8e4c00febc755a0691f4f668fe95;hb=e365f2f7a9c66d307b48fee70778f4eaa84bdcc0;hp=8bc2a885d098e73e9e30eb6220cb91bebcddc25f;hpb=6f1507bc47503d08288c72426b4e42011d909725;p=sbcl.git diff --git a/src/code/list.lisp b/src/code/list.lisp index 8bc2a88..2353c5a 100644 --- a/src/code/list.lisp +++ b/src/code/list.lisp @@ -301,7 +301,7 @@ (let ((result (list (car list)))) (do ((x (cdr list) (cdr x)) (splice result - (cdr (rplacd splice (cons (car x) '() ))) )) + (cdr (rplacd splice (cons (car x) '()))))) ((atom x) (unless (null x) (rplacd splice x)))) @@ -310,12 +310,12 @@ (defun copy-alist (alist) #!+sb-doc "Return a new association list which is EQUAL to ALIST." - (if (atom alist) + (if (endp alist) alist (let ((result (cons (if (atom (car alist)) (car alist) - (cons (caar alist) (cdar alist)) ) + (cons (caar alist) (cdar alist))) nil))) (do ((x (cdr alist) (cdr x)) (splice result @@ -325,10 +325,7 @@ (car x) (cons (caar x) (cdar x))) nil))))) - ;; Non-null terminated alist done here. - ((atom x) - (unless (null x) - (rplacd splice x)))) + ((endp x))) result))) (defun copy-tree (object) @@ -394,7 +391,7 @@ (defun nreconc (x y) #!+sb-doc "Return (NCONC (NREVERSE X) Y)." - (do ((1st (cdr x) (if (atom 1st) 1st (cdr 1st))) + (do ((1st (cdr x) (if (endp 1st) 1st (cdr 1st))) (2nd x 1st) ;2nd follows first down the list. (3rd y 2nd)) ;3rd follows 2nd down the list. ((atom 2nd) 3rd)