[comp.lang.lisp] Yet Another PCL/AKCL question

jkh@pcsbst.UUCP (jkh) (08/19/89)

Ok, you're probably sick of me by this time, but I promise that the
question is a simple one. I've got AKCL/Victoria PCL (5/22/89) working,
but am confused by some of the behaviour I'm seeing:

Using the simple examples from the book "Object Oriented Programming in
Common Lisp" by Sonya E. Keene for "lock" classes:

(defclass lock ()
  ((name :initarg :name :reader lock-name))
  (:documentation "The foundation of all locks."))

(defclass null-lock (lock)
  ()
  (:documentation "A lock that is always free."))

(defclass simple-lock (lock)
  ((owner :initform nil :accessor lock-owner))
  (:documentation "A lock that is either free or busy."))


I can create instances of both types of locks and query the names or set
the owner slot on the simple-lock type. However, getting to the next
set of examples, I get very different results.

Assuming that *null-lock* and *simple-lock* are instances of each, She says:

(type-of *null-lock*)		=> NULL-LOCK
(type-of *simple-lock*)		=> SIMPLE-LOCK

I get:
PCL>(type-of *null-lock*)	=> IWMC-CLASS

PCL>(type-of *simple-lock*)	=> IWMC-CLASS

Strange, no?

Also:

Doing (typep *simple-lock* 'simple-lock)
      (typep *null-lock* 'null-lock)
and   (type *simple-lock* 'lock)

Yield correct results.

However, she says that:

(subtypep 'simple-lock 'lock)		=> t t
(subtypep 'null-lock 'lock)		=> t t
(subtypep 'null-lock 'simple-lock)	=> t t

But I get:

PCL>(subtypep 'simple-lock 'lock)	=> NIL NIL

PCL>(subtypep 'null-lock 'simple-lock)	=> NIL NIL

PCL>(subtypep 'null-lock 'simple-lock)	=> NIL NIL

Any ideas?


Sigh. Trying to get this whole KCL/CLX/CLOS/CLUE stuff working together
is a *real* chore! I'm now beginning to understand why people are buying
DELPHI/IBUKI/LispWorks products. Still, it *is* interesting (haven't gotten
CLUE up yet, that should be fun). BTW, CLX is a *real dog*! Anybody know
why (besides the fact that the image is 6.9MB? :-)

				Jordan


-- 
--------
				Jordan Hubbard
				PCS Computer Systeme GmbH
				Munich, West Germany
	UUCP:			pyramid!pcsbst!jkh jkh@meepmeep.pcs.com
	EUNET:			unido!pcsbst!jkh
	ARPA:			jkh@violet.berkeley.edu hubbard@decwrl.dec.com