Willem Broekema | 28 Nov 2009 10:18
Picon

unfold-circular-list

There's a bug in unfold-circular-list, in that it calls subseq on a
circular list: subseq is defined as taking a "proper sequence". Below
is a patch.
- Willem

diff --git a/parse.lisp b/parse.lisp
index 4ee75b9..ab711b9 100644
--- a/parse.lisp
+++ b/parse.lisp
 <at>  <at>  -46,7 +46,7  <at>  <at> 
     (loop for x on list as i upfrom 0
 	as cdr-index = (find-cdr list (cdr x) i)
 	until cdr-index
-	finally (return (values (subseq list 0 (1+ i))
+	finally (return (values (loop repeat (1+ i) collect (pop list))
 				cdr-index)))))

 (defun symbol-package-fix-cl (symbol)

Frode V. Fjeld | 3 Dec 2009 22:51
Picon
Favicon

Re: unfold-circular-list

Willem Broekema <metawilm <at> gmail.com> writes:

> There's a bug in unfold-circular-list, in that it calls subseq on a
> circular list: subseq is defined as taking a "proper sequence". Below
> is a patch.

Just checked it in. Thanks!

--

-- 
Frode V. Fjeld


Gmane