X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Flist.lisp;h=2353c5a8f4fb8e4c00febc755a0691f4f668fe95;hb=e365f2f7a9c66d307b48fee70778f4eaa84bdcc0;hp=762561c4a1ffb653603982ba047ad4b07d406d93;hpb=d2241edb01a6dad8a7bc1107d28d0873f5f8d83e;p=sbcl.git diff --git a/src/code/list.lisp b/src/code/list.lisp index 762561c..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)