Christophe Rhodes wrote:
> Portable code is prohibited from subclassing built in classes, yes,
> but an implementation may yet make it possible -- I don't think
> (though I don't have CLHS access at the moment, so ignore me if I'm
> wrong) that the implementation is prohibited from allowing such
> subclasses to be made...
Well, the section quoted before said:
"The types cons, symbol, array, number, character, hash-table,
function, readtable, package, pathname, stream, random-state,
condition, restart, and any single other type created by
defstruct, define-condition, or defclass are pairwise disjoint,
except for type relations explicitly established by specifying
superclasses in defclass or define-condition or the :include
option of destruct."
You've brought up the possibility of using some means other than
defclass to break the disjointness property, but this section
seems to rule that out (it's a constraint on the classes, not
a constraint on conforming programs). Moreover, it's illegal
to use defclass to create subclasses of a built in class, not
just direct subclasses, so if (for example) STREAM has a subclass
TWO-WAY-STREAM that is not a built in class, it's still an error to
use defclass to specialize TWO-WAY-STREAM.