User level CLOS API collection library.
Name must be symbol or identifier.
Supers must be list of class.
Slots must be following structure:
_slots_ ::= (_slot_ ...)
_slot_ ::= (_slot-name_ _specifiers_*)
_specifiers_ ::= `:init-keyword` _keyword_
| `:init-value` _value_
| `:init-form` _form_
| `:reader` _reader-function_
| `:writer` _writer-function_
Defines a new class.
Slot specifiers:
:init-keyword
This keyword specifies initialisation keyword argument used by the
make
procedure. Following code describes how to use:
(make <a-class> :slot-a 'slot-a-value)
<a-class>
has a slot which slot definition contains the keyword
:init-keyword
with the keyword :slot-a. The code initialises
an instance of the slot with given value slot-a-value.
:init-value
This keyword specifies an initial value of target slot.
:init-form
Similar with :init-keyword
but this keyword takes expression which
will be evaluated at initialiation time.
:reader
This keyword creates a procedure takes 1 argument an instance of the class
to access the slot, so users can read the slot without using slot-ref
procedure.
:writer
This keyword creates a procedure takes 2 argument an instance of the class
and object to set the slot value with given object, so users can set the
slot without using slot-set!
procedure.
opttions can specify the metaclass of this class with keyword
:metaclass
.
NOTE: Current implementation does not support :allocation
keyword
by default. If you need it, see
(sagittarius mop allocation).
Name must be symbol.
Creates a new generic function.
By specifying class keyword argument, users can customize the behaviour of the method specialization.
We provide <predicate-specializable-generic>
for memq
, memv
, member
and predicate
specializer.
Name must be symbol.
Specifiers must be following structure:
_specifiers_ ::= (_spec_ ... _rest_)
_spec_ ::= (_argument-name_ _class_)
| (_argument-name_)
| (_argument-name_ (_specializer_ value))
_rest_ ::= '() | symbol
_specializer_ ::= `eq` | `eql` | `equal` | `eq?` | `eqv?` | `equal?`
Adds defined method to name generic. If the generic does not exist, this will create a new generic function implicitly.
Returns the slot value specified slot-name.
Sets the slot value value with specified slot-name.
Returns #t if the slot value specified slot-name is bounded, otherwise #f.
Creates a new instance of class
Returns #t if object is an instance of class, otherwise #f.
Returns #t if class1 is a subclass of class2, otherwise #f.
This procedure is for MOP.
Returns the slot value got by accessor.
This procedure is for MOP.
Sets the slot value value to object using accessor.
This procedure is for MOP.
Returns the slot value according to the given class.
It is an error if the given slot-name doesn't exist in the class.
This procedure is for MOP.
Sets the slot value value to object accoring to the given class.
It is an error if the given slot-name doesn't exist in the class.
This procedure is for MOP.
Returns #t if the slot is bounded according to the given class, otherwise #f.
It is an error if the given slot-name doesn't exist in the class.
This method will be called when writing the given object.
Defines how user defined class should be written.
This method will be called when equal?
is called.
Defines how user defined class should be compared.