[movitz-cvs] CVS update: movitz/losp/muerte/typep.lisp

Frode Vatvedt Fjeld ffjeld at common-lisp.net
Thu Nov 18 09:28:54 UTC 2004


Update of /project/movitz/cvsroot/movitz/losp/muerte
In directory common-lisp.net:/tmp/cvs-serv28275

Modified Files:
	typep.lisp 
Log Message:
Added some trival cases for (coerce .. 'list) and (coerce .. 'vector)

Date: Thu Nov 18 10:28:53 2004
Author: ffjeld

Index: movitz/losp/muerte/typep.lisp
diff -u movitz/losp/muerte/typep.lisp:1.37 movitz/losp/muerte/typep.lisp:1.38
--- movitz/losp/muerte/typep.lisp:1.37	Wed Sep 15 12:22:59 2004
+++ movitz/losp/muerte/typep.lisp	Thu Nov 18 10:28:52 2004
@@ -9,7 +9,7 @@
 ;;;; Created at:    Fri Dec  8 11:07:53 2000
 ;;;; Distribution:  See the accompanying file COPYING.
 ;;;;                
-;;;; $Id: typep.lisp,v 1.37 2004/09/15 10:22:59 ffjeld Exp $
+;;;; $Id: typep.lisp,v 1.38 2004/11/18 09:28:52 ffjeld Exp $
 ;;;;                
 ;;;;------------------------------------------------------------------
 
@@ -620,5 +620,11 @@
   (cond
    ((typep object result-type)
     object)
+   ((and (eq result-type 'list)
+	 (typep object 'sequence))
+    (map 'list #'identity object))
+   ((and (typep object 'sequence)
+	 (member result-type '(vector array)))
+    (make-array (length object) :initial-contents object))
    (t (error "Don't know how to coerce ~S to ~S." object result-type))))
 





More information about the Movitz-cvs mailing list