[Openmcl-devel] Unknown Type Specifier and structs
Michael Maul
mike.maul at gmail.com
Mon Jun 23 15:13:55 PDT 2014
Any ideas on the code below causing 'Unknown Type Specifier' condition.
Works fine on SBCL however CCL throws condition. I think it may relate to
the :type specification referencing cluster in the point struct definition.
As if I eval just the cluster struct then reload the module the condition
is not thown.
Unknown type specifier: HJS.LEARN.K-MEANS:CLUSTER
[Condition of type SIMPLE-ERROR]
Backtrace:
0: (CCL::%%TYPEP NIL #<UNKNOWN-CTYPE HJS.LEARN.K-MEANS:CLUSTER>)
1: (TYPEP NIL HJS.LEARN.K-MEANS:CLUSTER NIL)
;; Code Fragment
(declaim (optimize (speed 3) (debug 1) (safety 1)))
;;;; data and type definition
(deftype id () 'fixnum)
(defstruct (cluster (:conc-name c-)
(:constructor %make-cluster (id center))
(:copier copy-cluster))
(id -1 :type id)
(center #.(make-dvec 0) :type dvec)
(old-center #.(make-dvec 0) :type dvec)
(size 0 :type fixnum)
(points nil :type list)
)
(defun make-cluster (id center)
(let ((center (coerce center 'dvec)))
(check-type id id)
(check-type center dvec)
(let ((result (%make-cluster id (copy-seq center))))
(setf (c-old-center result) (copy-seq center))
result)))
(defstruct (point (:conc-name p-)
(:constructor %make-point (id pos))
(:copier copy-point))
(id -1 :type id)
(pos #.(make-dvec 0) :type dvec)
(owner nil :type cluster) ;
)
...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20140623/0e040d17/attachment.htm>
More information about the Openmcl-devel
mailing list