I personally wrote a macro DEFCLASS* that wraps in a load eval compile.
Apparently you can add 'compile to the variable pcl::*defclass-times*
that should solve the problem.
Tunc
p.s. you don't have an error, its only a warning.
kp gores wrote:
>
> hi,
>
> using cmucl on sun solaris i found this strange behavior of defclass:
> when compiling
>
> (defclass a ()
> ((b :initarg :b :accessor b))) ;)
>
> (defmethod print-object ((a a) stream)
> (format stream "this is an a ~S~%" (b a)))
>
> i get the error
> In: DEFMETHOD PRINT-OBJECT (A T)
> (DEFMETHOD PRINT-OBJECT
> ((A A) STREAM)
> (FORMAT STREAM "this is an a ~S~%" (B A)))
> Warning: Undefined type: A
>
> wrapping the defclass with eval-when (compile load) solves the problem.
>
> why does the compile error happen, i.e. shouldn't the compiler know the
> class A?
> is it ok to "fix" the problem with eval-when?
>
> regards
> kp gores
>
> --
> superegos talker