define-ks-class | | ks-class-name
( {superclass-name}*)
( {slot-specifier}*)
{class-option}*
=> new-ks-class | [Macro]
|
Purpose
Define or redefine a ks class.
Package :agenda-shell
Module :agenda-shell
Arguments and values
Returns
The newly defined or modified ks class object.
Errors
The specified superclass-names do not include at least
one ks class name. This error is signaled on class finalization.
Detailed syntax
[Syntax shown in gray is
not supported in GBBopen Version 1.5, but will become
available in a future release.]
slot-specifier ::=
| slot-name | |
| ( nonlink-slot-name
[[nonlink-slot-option]]) | |
| ( link-slot-name [[link-slot-option]]) |
|
nonlink-slot-name ::= | slot-name |
|
link-slot-name ::= | slot-name |
|
link-slot-option ::=
| slot-option | |
| {:link inverse-link-slot-specifier} | |
| {:singular boolean} | |
| {:sort-function function} | |
| {:sort-key function} |
|
inverse-link-slot-specifier ::= |
( unit-class-name link-slot-name
[:singular boolean]) | |
| :reflexive |
|
nonlink-slot-option ::=
| slot-option | |
| {:reader reader-function-name}* | |
| {:writer writer-function-name}* |
|
slot-option ::=
| {:accessor reader-function-name}* | |
| {:allocation allocation-type} | |
| {:documentation string} | |
| {:initarg initarg-name}* | |
| {:initform form} | |
| {:type type-specifier} |
|
class-option ::=
| (:abstract boolean) | |
| (:default-initargs . initarg-list) | |
| (:dimensional-values
dimension-value-specifier*) | |
| (:documentation string) | |
| (:estimated-instances integer) | |
| (:export-accessors boolean) | |
| (:export-class-name boolean) | |
| (:export-slot-names direct-slots-specifier) | |
| (:generate-accessors direct-slots-specifier) | |
| (:generate-accessors-format
{:prefix | :suffix } | |
| (:generate-accessors-prefix {string |
symbol}) | |
| (:generate-accessors-suffix {string |
symbol}) | |
| (:generate-initargs direct-slots-specifier) | |
| (:initial-space-instances
initial-space-instance-specifier) | |
| (:instance-name-comparison-test
instance-name-comparison-test) | |
| (:metaclass class-name) | |
| (:retain {boolean
| :propagate }) | |
| (:use-global-instance-name-counter boolean) |
|
initial-space-instance-specifier ::=
| {space-instance-path+ |
function} |
|
dimension-value-specifier ::=
| incomposite-dv-specifier | composite-dv-specifier |
|
incomposite-dv-specifier ::=
| ( dimension-name dimension-value-spec
dimension-value-place) |
|
composite-dv-specifier ::=
| ( dimension-name dimension-value-specifier |
| composite-type dimension-value-place) |
|
composite-type ::=
| :set | :sequence | |
| {:ascending-series ordering-dimension-name} | |
| {:descending-series ordering-dimension-name} |
|
dimension-value-specifier ::=
| dimension-value-type | |
| ( ordered-dimension-value-type
[ordered-comparison-type]) | |
| ( enumerated-dimension-value-type
[enumerated-comparison-type]) | |
| ( boolean-dimension-value-type
[boolean-comparison-type]) |
|
dimension-value-type ::=
| ordered-dimension-value-type | |
| enumerated-dimension-value-type | |
| boolean-dimension-value-type |
|
ordered-dimension-value-type ::=
| :point | :interval | :mixed |
|
enumerated-dimension-value-type ::=
| :element |
|
boolean-dimension-value-type ::=
| :boolean |
|
ordered-comparison-type ::=
| number | fixnum |
short-float | single-float | |
| double-float | long-float | |
| pseudo-probability |
|
enumerated-comparison-type ::=
| eq | eql |
equal | equalp |
|
boolean-comparison-type ::=
| t |
|
dimension-value-place ::=
| {slot-name [slot-name]} |
{function [slot-name]} |
|
direct-slots-specifier ::= | nil | t |
included-slot-name* | |
| {t :exclude excluded-slot-name*} |
|
The default ordered-comparison-type, if unspecified, is
number
. The default enumerated-comparison-type,
if unspecified, is eql
. The default
boolean-comparison-type is t
.
A dimension-value-place with two slot-names is
allowed only for an :interval
dimension-value specification.
Terms
Description
A dimension-value-place with two
slot-names can be specified only for :interval
dimension-value types.
Each superclass-name argument specifies a direct superclass of the new
class. If the superclass list is empty, then the direct superclass defaults to
the single class ks.
The :metaclass
class-name class option, if specified,
must be a subclass of standard-unit-class. The
default metaclass value is also
standard-unit-class.
Inheritance of class options
The set of dimensional-values for a unit class is the
union of the sets specified in the dimensional-values options
of the class and its superclasses. When more than one dimension-value
specification is supplied for a given dimension, the one supplied by the
most specific class is used.
The effective initial-space-instances value for a
unit class is the value specified in the definition of the most
specific unit class. (No additive inheritance of
initial-space-instances is performed.) If no definitions
specify an initial-space-instances value, nil
is used.
The instance-name-comparison-test value is not inherited. If
no value is specified in the unit-class definition, the default
initialization value associated with the metaclass is used.
If a retain value is not specified, a value of
:propagate
is used as the default if any parent
unit classes have a :propagate
retention value;
otherwise nil
is used as the default value.
The use-global-instance-name-counter value is not
inherited. If no value is specified in the unit-class definition,
the default initialization value associated with the metaclass is used.
See also
define-ks
delete-blackboard-repository
standard-unit-class
with-generate-accessors-format
Examples
Define a ks class, ks-with-lock
, that has an
additional slot containing a lock that can be used to
synchronize operations on each defined KS of that class.
> (define-ks-class ks-with-lock ()
((lock :initform (make-lock :name "KS Lock"))))
#<standard-unit-class ks-with-lock>
>
Do the same, but with a mixin class:
> (define-unit-class ks-lock-mixin ()
((lock :initform (make-lock :name "KS Lock"))))
#<standard-unit-class ks-lock-mixin>
> (define-ks-class ks-with-lock (ks ks-lock-mixin)
())
#<standard-unit-class ks-with-lock>
>
The GBBopen Project