Node:Class Definition Internals, Next:Customizing Class Definition, Previous:Slot Options, Up:Defining New Classes
Implementation notes: define-class
expands to an expression which
class
to create the new class (see class)
class-redefinition
(see Redefining a Class).
class name (super ...) slot-definition ... . options | syntax |
Return a newly created class that inherits from supers, with direct slots defined by slot-definitions and class options options. For the format of slot-definitions and options, see define-class. |
Implementation notes: class
expands to an expression which
#:init-form
option to an
#:init-thunk
option, to supply a default environment parameter
(the current top-level environment) and to evaluate all the bits that
need to be evaluated
make-class
to create the class with the processed and
evaluated parameters.
make-class supers slots . options | procedure |
Return a newly created class that inherits from supers, with
direct slots defined by slots and class options options.
For the format of slots and options, see define-class, except note that for make-class ,
slots and options are separate list parameters: slots
here is a list of slot definitions.
|
Implementation notes: make-class
<object>
to the supers list if supers is empty
or if none of the classes in supers have <object>
in their
class precedence list
#:environment
, #:name
and #:metaclass
options, if they are not specified by options, to the current
top-level environment, the unbound value, and (ensure-metaclass
supers)
respectively (see ensure-metaclass)
make
, passing the metaclass as the first parameter and all
other parameters as option keywords with values.
ensure-metaclass supers env | procedure |
Return a metaclass suitable for a class that inherits from the list of
classes in supers. The returned metaclass is the union by
inheritance of the metaclasses of the classes in supers.
In the simplest case, where all the supers are straightforward
classes with metaclass For a more complex example, suppose that supers contained one
class with metaclass If supers is the empty list, GOOPS keeps a list of the metaclasses created by
The |
ensure-metaclass-with-supers meta-supers | procedure |
ensure-metaclass-with-supers is an internal procedure used by
ensure-metaclass (see ensure-metaclass). It returns a metaclass that is the union by
inheritance of the metaclasses in meta-supers.
|
The internals of make
, which is ultimately used to create the new
class object, are described in Customizing Instance Creation,
which covers the creation and initialization of instances in general.