A class definition may include the
concrete. These adjectives declare characteristics of
Additional restrictions on the ability to subclass classes may be imposed by
- An explicitly defined class can be declared to be either
sealed or open. If a class is sealed then no additional direct
subclasses other than those explicitly known in the same library may be created. Thus, it
is an error to define a direct subclass of a sealed class in some library other than the
one that defined the sealed class, or to use
<class>with a sealed class included in the direct superclasses specified by the
superclasses:initialization argument. An open class does not prohibit such operations.
When explicitly defining a class, the default is for the class to be sealed. This may be overriden by explicitly specifying that it is open. A class created using
<class>is open. There is no specified way to create a sealed class using
- An explicitly defined class may be declared to be either primary or free. The default is free. Each primary superclass of a class must be either a subclass or a superclass of all the other primary superclasses of the class. (This essentially restricts primary classes to forming a single inheritance chain.) Slots defined in a primary class may be accessed more efficiently than slots defined in a free class.
- An explicitly defined class may be defined to be either abstract or
concrete. The default is concrete. The superclasses of an abstract class must be
abstract. The default method on
makewill signal an error if passed an abstract class. For an abstract class to be instantiable, it must define a method on
makethat delegates to a concrete subclass.