0.9.4.54:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 9 Sep 2005 14:16:17 +0000 (14:16 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 9 Sep 2005 14:16:17 +0000 (14:16 +0000)
commit0aecc2b20142e08068c3434273500131cb13fe2d
tree3a552cd8e60bc49eccd9b84521460b0741740d81
parentbe7adb92bf0012ab07adac2943e73772dfad7911
0.9.4.54:
Declassification of INSTANCE and FUNCALLABLE-INSTANCE.

It turns out that the classes INSTANCE and
        FUNCALLABLE-INSTANCE, as expressed in instance-pointer-lowtag
and funcallable-instance-widetag, are incompatible with the
MOP's notion of classes: the types INSTANCE and
FUNCALLABLE-INSTANCE are necessarily disjoint (no instance can
have a widetag of anything other than instance-header-widetag),
but FUNCALLABLE-STANDARD-OBJECT is required to be a subclass of
STANDARD-OBJECT, and must therefore have the superclasses of
STANDARD-OBJECT among its superclasses.  If INSTANCE is one of
those, FUNCALLABLE-INSTANCE cannot be, so F-S-Os would not be of
type FUNCALLABLE-INSTANCE (which is wrong); if it is not one of
those, then ordinary S-Os would not be of type INSTANCE (which
is wrong).  CMUCL, at the time of writing, exhibits type system
confusion in this area, as demonstrated by CSR cmucl-imp
2005-09-0x).

So, we need to do something else; probably most straightforward
to make INSTANCE and FUNCALLABLE-INSTANCE named types, as they
are of the same order of specialness as e.g. T -- not quite as
special, but almost.  Some hacking later...

... the usual type system dance.  Play whack-a-mole with test
failures and compilation failures until they all go
away.  Primtype, class, typetran, and so on are
fiddled with.
... somewhat hacky code for determining when a class is subtypep
instance / funcallable-instance.
... different hard-coded constants for genesis; don't make a
special instance-layout, because the instance class is
gone.
... just to prove we've achieved something, make STANDARD-OBJECT
a superclass of FUNCALLABLE-STANDARD-OBJECT.
(Supporting METAOBJECT should be straightforward now)
... many many new tests, both of the before-xc variety (it's
amazing in how many ways I can get the type system
wrong) and of the regular form.  Also add some
ctor tests that aren't exercised yet.
30 files changed:
NEWS
contrib/sb-aclrepl/inspect.lisp
src/code/class.lisp
src/code/condition.lisp
src/code/cross-misc.lisp
src/code/cross-type.lisp
src/code/defstruct.lisp
src/code/early-extensions.lisp
src/code/fop.lisp
src/code/inspect.lisp
src/code/interr.lisp
src/code/late-type.lisp
src/code/pred.lisp
src/code/primordial-type.lisp
src/code/target-defstruct.lisp
src/code/target-type.lisp
src/code/typep.lisp
src/compiler/generic/genesis.lisp
src/compiler/generic/primtype.lisp
src/compiler/typetran.lisp
src/pcl/ctor.lisp
src/pcl/defs.lisp
src/pcl/low.lisp
tests/clos.impure-cload.lisp
tests/clos.impure.lisp
tests/mop.pure.lisp [new file with mode: 0644]
tests/type.before-xc.lisp
tests/type.impure.lisp
tests/type.pure.lisp
version.lisp-expr