11 The Built-In Classes
<object>
Function | Description | Page | |
---|---|---|---|
instance? | Tests whether an object is an instance of a type. | 329 | |
subtype? | Tests whether a type is a subtype of another type. | 330 | |
union | Returns the union of two types. | 251 |
<type>
<class>
or <sequence>
specifying the direct superclasses of the class. If it is a sequence, the elements of the sequence must be instances of <class>
. The default value is <object>. The meaning of the order of the superclasses is the same as in define class.
abstract?:
<boolean>
specifying whether the class is abstract or concrete. The default value is #f
.
<sequence>
containing slot specs, where each slot-spec is a sequence of keyword/value pairs.
#f
indicating "no setter." Unless the allocation of the slot is virtual, the setter method for the slot will be added to this generic function. The default value is #f
.
type:
or deferred-type:
may be specified, but not both.
make
, as a keyword argument using this keyword. This option cannot be specified for a virtual slot. There is no default. This option cannot be specified along with required-init-keyword:.
In most programs the majority of classes are created with define class. However, there is nothing to prevent programmers from creating classes by calling make, for example, if they want to create a class without storing it in a module binding, or if they want to create new classes at runtime.
If make is used to create a new class and creating the new class would violate any restrictions specified by sealing directives, then an error of type <sealed-object-error> is signaled.
<class>
provides the following operations:
Function | Description | Page | |
---|---|---|---|
all-superclasses | Returns all the superclasses of a class. | 330 | |
direct-superclasses | Returns the direct superclasses of a class. | 331 | |
direct-subclasses | Returns the direct subclasses of a class. | 331 |
Function | Description | Page | |
---|---|---|---|
make | Returns a general instance of its first argument. | 245 | |
limited | Returns a limited subtype of a class. | 249 |
Function | Description | Page | |
---|---|---|---|
make | Returns a general instance of its first argument. | 245 |
<type>
<object>
. The object that the singleton indicates. There is no default for this argument. If it is not supplied, an error will be signaled.
If a singleton for the specified object already exists, implementations may return it rather than allocating a new singleton.
Generated with Harlequin WebMaker