[Mkcl-devel] [Bug] (coerce obj 'list) returns reversed list

金舜琳 3han5chou7 at gmail.com
Sat Sep 6 02:24:09 UTC 2014


Hi, there

I found a bug.
mkcl returns:
(print (coerce "string" 'list)) ; => (#\g #\n #\i #\r #\t #\s)
but CLHS http://clhs.lisp.se/Body/f_coerce.htm specifies `coerce` to return
the same sequence as origin.

Because I couldn't find CONTRIBUTING file, I've attached my patch.

Bests
-- 
the Univ. of Tokyo math dept.
Sunrim KIM/金 舜琳 (きん すんりん)
Mail: 3han5chou7 at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/mkcl-devel/attachments/20140906/66e34a2c/attachment.html>
-------------- next part --------------
diff --git a/src/lsp/predlib.lsp b/src/lsp/predlib.lsp
index 096f039..00c233c 100644
--- a/src/lsp/predlib.lsp
+++ b/src/lsp/predlib.lsp
@@ -782,7 +782,7 @@ if not possible."
 	   (LIST
 	    (do ((io (make-seq-iterator object) (seq-iterator-next object io))
 	         (l nil (cons (seq-iterator-ref object io) l)))
-	        ((null io) l)))
+	        ((null io) (nreverse l))))
            (BASE-CHAR (let ((new (character object)))
                         (if (mkcl:base-char-p new) new (error-coerce object type))))
 	   (CHARACTER (character object))


More information about the mkcl-devel mailing list