Commit e4297f35 authored by wlott's avatar wlott
Browse files

Fixed coerce to call type-expand so that people can coerce to deftypes.

parent 1b56c58e
......@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/seq.lisp,v 1.15 1993/11/02 16:12:54 ram Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/seq.lisp,v 1.16 1994/02/04 15:25:43 wlott Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -798,6 +798,7 @@
(defun coerce (object output-type-spec)
"Coerces the Object to an object of type Output-Type-Spec."
(let ((output-type-spec (type-expand output-type-spec)))
(cond
((typep object output-type-spec)
object)
......@@ -845,7 +846,8 @@
((simple-string string simple-base-string base-string)
(vector-to-string* object))
((simple-bit-vector bit-vector) (vector-to-bit-vector* object))
((vector array simple-array) (vector-to-vector* object output-type-spec))
((vector array simple-array)
(vector-to-vector* object output-type-spec))
(t (error "Can't coerce ~S to type ~S." object output-type-spec))))
(string
(case (type-specifier-atom output-type-spec)
......@@ -873,7 +875,8 @@
((simple-vector vector array simple-array)
(vector-to-vector* object output-type-spec))
(t (error "Can't coerce ~S to type ~S." object output-type-spec))))
(t (error "~S is an inappropriate type of object for coerce." object))))))
(t
(error "~S is an inappropriate type of object for coerce." object)))))))
;;; Internal Frobs:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment