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

Re: interactions between defclass and type specifier



    Date: Wed, 3 Aug 88 13:31:14 -0200
    From: adf@ztivax.siemens.com (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
objects.

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.
-------