From: Nils Goesche
Subject: Find workaround for defclass bug in CMUCL
Date: 
Message-ID: <87bsul5aut.fsf@darkstar.cartan>
Hi!

CMUCL appears to have an annoying bug: When the following code is
compiled,

(defclass tst ()
  ((foo :initform "Foo" :accessor tst-foo)
   (bar :initform "Bar" :accessor tst-bar)))

(defmethod prt ((c tst))
  (tst-bar c))

you get two warnings:
| In: defmethod prt (tst)

[snip]

| Warning: Undefined type: tst
| Warning: This type is undefined:
|  tst


A workaround is to write

(eval-when (:compile-toplevel :load-toplevel :execute)
  (defclass tst ()
    ((foo :initform "Foo" :accessor tst-foo)
     (bar :initform "Bar" :accessor tst-bar))))

instead.  Now I am wondering whether there is a way to fix this
bug in the init-file.  Is it possible to tell the compiler/reader
whatever to always eval-when ... any top-level defclass form?

I experimented with defmacro/define-compiler-macro for a while
but to no avail.  Any ideas?

Regards,
-- 
Nils Goesche
Ask not for whom the <CONTROL-G> tolls.
From: Tim Bradshaw
Subject: Re: Find workaround for defclass bug in CMUCL
Date: 
Message-ID: <ey3y9xoial4.fsf@cley.com>
* Nils Goesche wrote:

> instead.  Now I am wondering whether there is a way to fix this
> bug in the init-file.  Is it possible to tell the compiler/reader
> whatever to always eval-when ... any top-level defclass form?

I think you want to look at PCL::*DEFCLASS-TIMES*, and make sure it
contains COMPILE.

--tim