Commit graph

17 commits

Author SHA1 Message Date
Douglas Katzman cd04e47f53 Really enforce test purity
Signal ERROR if ambient changes are detected.
2022-01-15 11:50:11 -05:00
Christophe Rhodes 561146c37d Allow TYPEP tests of SB-PCL::SLOT-OBJECT to work
SLOT-OBJECT is a PCL convenience, allowing for shared definitions in
class initialization and slot access on conditions, structure objects
and standard objects.  The non-PCL parts of the system don't place
a layout for SLOT-OBJECT in the layout-inherits of structures, so
TYPEP was reporting NIL always.

Effectively, though, SLOT-OBJECT is the union of STRUCTURE-OBJECT,
STANDARD-OBJECT and CONDITION, so inform the classoids of this.  In
the process delete what must be dead code in CLASS-TEST, because
SYSTEM-CLASSOID has not named a type for quite some time.
2021-03-05 08:58:45 +00:00
Douglas Katzman e2e0945870 Remove exports from SB-PCL 2020-06-01 17:54:12 -04:00
Douglas Katzman b368bfe0f0 Combine two slots of CTYPE instances
* TYPE-CLASS-INFO can be represented in 5 bits holding an index to the
  respective element of *TYPE-CLASSES*.  Pack those into TYPE-HASH-VALUE.

* Remove logic from cold-init that patched in a TYPE-CLASS to each
  CTYPE instance that was constructed in genesis.

* Use the same number of hash bits regardless of machine word size.
  Remove cold-init logic to "improve" hashes produced from cross-compilation.
  The LCG PRNG is quite possibly just as random as an address-based hash.

* Use deterministic hashes for CLASSOID, like for LAYOUT.

* Rename TYPE-CLASS-INFO accessor to TYPE-CLASS.

* Change TYPE-CLASS from a DEF!STRUCT to a regular DEFSTRUCT.
2020-01-17 11:15:16 -05:00
Douglas Katzman 678b4ec311 Small speedup to FIND-SLOT-CELL (perhaps 5% faster) 2014-11-03 00:29:33 -05:00
Douglas Katzman 91f7d85a95 Use STD-COMPUTE-SLOTS for {STRUCTURE,CONDITION}-CLASS. Fixes lp#1049423 2014-11-02 20:49:32 -05:00
Christophe Rhodes 11b217c486 fix bug #1332983
the universal superclass is a special-case for validate-superclass.
That has knock-on implications on its metaclass (can't be
built-in-class) which means we have to document an exception to
another part of AMOP.
2014-09-01 11:45:32 +01:00
Stas Boukarev 4e4d7e4108 Replace (assert (raises-error? ...)) with assert-error. 2014-05-29 18:15:34 +04:00
Stas Boukarev 2ea1111db2 Fix clos.pure.lisp.
clos.pure stumbles on anonymous class created by mop.pure.
2014-04-20 14:55:47 +04:00
Stas Boukarev edbf1a2a11 Fix conditions initform inheritance.
SB-KERNEL::COMPUTE-EFFECTIVE-SLOTS got the source and destination
mixed up.

The fact the test didn't actually test anything didn't help.

Fixes lp#1300904.
2014-04-01 22:29:18 +04:00
Christophe Rhodes 885a956ae2 signal errors for bad initialization of slot definitions
In order to get slot definition initialization right, move the
readers/writers slots to direct slot definitions, and write code to
detect all the bad cases documented in the MOP dictionary at
initialization time.  Condition slots also need changing, to have
separate initform and initfunction information.  Moving the slots
breaks metacircle resolution, naturally, so rewrite that to find the
relevant reader/writer information from the direct slots at runtime.
The irony of having to rewrite metacircle detection and resolution for
a bug tagged "easy" on launchpad is not lost on me.

Originally reported by Bruno Haible at some point in prehistory,
probably around December 2004, lp#309072.
2013-10-21 12:15:04 +01:00
Nikodemus Siivola 1f9c4bb952 make ENSURE-GENERIC-FUNCTION accept method combination arguments
Previously we only accepted a list designating the method combination, but
  since MOP also specifies a way to grab the actual method combination, we
  should really accept that as well.

  Fixes bug 936513.
2012-05-21 08:43:11 +03:00
Nikodemus Siivola 554303a521 1.0.23.26: AMOPly correct defaulting of direct superclasses
"The class standard-object is the default direct superclass of the
  class standard-class. When an instance of the class standard-class
  is created, and no direct superclasses are explicitly specified, it
  defaults to the class standard-object."

  "The same is true for funcallable-standard-class and
  funcallable-standard-object."

  * Add :DEFAULT-INITARGS to that effect.
2008-12-05 13:47:37 +00:00
Christophe Rhodes 99df968112 0.9.10.2:
Fix remaining slot name publicness in standardized classes.
	... be cowardly and just rename TYPE to %TYPE, but write a
		comment about why this isn't really good enough.
	... now we can test for our interpretation.
	... document it, too
2006-02-27 11:02:11 +00:00
Christophe Rhodes feea06ce0a 0.9.4.57:
Implement the METAOBJECT class as per AMOP.
	... we can do this safely now that INSTANCE and
		FUNCALLABLE-INSTANCE confusion has been resolved.
		Woohoo.
2005-09-09 20:27:59 +00:00
Christophe Rhodes 1a405defbd 0.9.4.55:
The class SB-PCL::STD-OBJECT is now useless: delete it
	mercilessly.
	... this means that there are no direct instances of STD-CLASS
		any more: so it can be removed from the braid.
	... document that we're no longer nonconforming wrt
		{,funcallable-}standard-object
2005-09-09 16:09:51 +00:00
Christophe Rhodes 0aecc2b201 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.
2005-09-09 14:16:17 +00:00