r8447: add string->list
[kmrcl.git] / strings.lisp
index e9a73a3c9c7f1c3041680fc6cc9b5466bb08fe03..8eb08f74e9faa7ac1b243ee78988db6b2a239444 100644 (file)
@@ -627,3 +627,10 @@ for characters in a string"
         (t
          (setq in-white nil)
          (write-char c stream)))))))
+
+(defun string->list (string)
+  (let ((eof (list nil)))
+    (with-input-from-string (stream string)
+      (do ((x (read stream nil eof) (read stream nil eof))
+           (l nil (cons x l)))
+          ((eq x eof) (nreverse l))))))