[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: interactions between defclass and type specifier
- To: Angela Dappert-Farquhar <email@example.com>
- Subject: Re: interactions between defclass and type specifier
- From: Gregor.pa@Xerox.COM
- Date: Wed, 3 Aug 88 10:18 PDT
- Cc: commonloops.pa@Xerox.COM
- Fcc: BD:>Gregor>mail>outgoing-mail-3.text.newest
- In-reply-to: <8808031131.AA03807@ztivax.uucp>
- Line-fold: no
Date: Wed, 3 Aug 88 13:31:14 -0200
From: firstname.lastname@example.org (Angela Dappert-Farquhar)
I have a bug I don't really understand:
We defined (defclass member ()()) and this messes up the type checks
with specifier 'member'.
(typep 'a '(member a b c)) returns NIL instead of T.
I don't know in how far PCL changed the type system or where this
interaction could occur.
Could you give me a hint? What other class names would one have to watch
out? I dont have problems with (defclass and () ()) and
(typep 'a (and symbol t)) or something like this.
In CLOS, class names are valid as type specifiers. So are class
PCL implements this by defining a type with the same name as the class,
whenever a named class is defined. This doesn't really conform to the
spec since it doesn't work if someone uses setf of find-class to move
around class objects, but it is the closest I can get in portable code.
So, you shouldn't define any classes whose name is the same as the name
of any existing type specifier. Why you were able to win with AND, I
have no idea, this should not have worked, and is not legal in CLOS.