[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subtypep questions

I am sure that this question has come up here before, but I have looked
back through the archives and I cannot find the answer.  I am trying to
teach myself about CLOS and therefore have been going through Keene's 
book and trying the examples.  However the first one I try doesn't seem
to be working out.  The following is a section of a recent transcript
from Allegro CL 1.2.1 on my Mac II.

? (defclass lock () ((name :initarg :name :reader lock-name)))
#<Standard-Class lock 2638932>
? (defclass null-lock (lock) ())
#<Standard-Class null-lock 2673068>
? (defclass simple-lock (lock) 
            ((owner :initform nil :accessor lock-owner)))
#<Standard-Class simple-lock 2521500>
? (subtypep 'simple-lock 'lock)

***  QUESTION NUMBER 1, why does this not return t t as I would expect?

? (setq *null-lock* 
        (make-instance 'null-lock :name "Null lock"))
#<null-lock 2533152>
? (setq *simple-lock* 
        (make-instance 'simple-lock :name "Simple lock"))
#<simple-lock 2537148>
? (type-of *null-lock*)

***  QUESTION NUMBER 2, What is this iwmc-class, and what has happened to
                        my null-lock class?

? (typep *simple-lock* 'simple-lock)
***  COMMENT NUMBER 1, Well at least something worked as I expected.

Any comments or advice to point this wayward programmer in the right direction
would be sincerely appreciated.  Thanks in advance.