Update of /cvsroot/sbcl/sbcl/contrib/sb-aclrepl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28622/contrib/sb-aclrepl
Modified Files:
inspect.lisp
Log Message:
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.
Index: inspect.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/contrib/sb-aclrepl/inspect.lisp,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- inspect.lisp 14 Jul 2005 16:30:07 -0000 1.29
+++ inspect.lisp 9 Sep 2005 14:16:18 -0000 1.30
@@ -567,9 +567,6 @@
(defmethod inspected-description ((object standard-object))
(format nil "~W" (class-of object)))
-(defmethod inspected-description ((object sb-kernel:funcallable-instance))
- (format nil "a funcallable-instance of type ~S" (type-of object)))
-
(defmethod inspected-description ((object function))
(format nil "~S" object) nil)
@@ -807,10 +804,6 @@
(let ((components (inspected-standard-object-parts object)))
(list components (length components) :named nil)))
-(defmethod inspected-parts ((object sb-kernel:funcallable-instance))
- (let ((components (inspected-standard-object-parts object)))
- (list components (length components) :named nil)))
-
(defmethod inspected-parts ((object condition))
(let ((components (inspected-standard-object-parts object)))
(list components (length components) :named nil)))
|