<div dir="ltr"><div>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. <br>
</div><div><br>Unknown type specifier: HJS.LEARN.K-MEANS:CLUSTER<br> [Condition of type SIMPLE-ERROR]<br><br><br>Backtrace:<br> 0: (CCL::%%TYPEP NIL #<UNKNOWN-CTYPE HJS.LEARN.K-MEANS:CLUSTER>)<br> 1: (TYPEP NIL HJS.LEARN.K-MEANS:CLUSTER NIL)<br>
<br><br></div>;; Code Fragment<br><div>(declaim (optimize (speed 3) (debug 1) (safety 1)))<br>;;;; data and type definition<br>(deftype id () 'fixnum)<br><br><br>(defstruct (cluster (:conc-name c-)<br> <br>
(:constructor %make-cluster (id center))<br> <br> (:copier copy-cluster))<br> (id -1 :type id)<br> (center #.(make-dvec 0) :type dvec)<br> (old-center #.(make-dvec 0) :type dvec)<br>
(size 0 :type fixnum)<br> (points nil :type list)<br> )<br><br><br>(defun make-cluster (id center)<br> (let ((center (coerce center 'dvec)))<br> (check-type id id)<br> (check-type center dvec)<br> (let ((result (%make-cluster id (copy-seq center))))<br>
(setf (c-old-center result) (copy-seq center))<br> result)))<br><br>(defstruct (point (:conc-name p-)<br> (:constructor %make-point (id pos))<br> (:copier copy-point))<br> (id -1 :type id)<br>
(pos #.(make-dvec 0) :type dvec)<br> (owner nil :type cluster) ; <br> )<br>...<br><br></div></div>