define-ks-classAgenda Control Shelldescribe-ksdefine-ksa-classGoTo Top

define-ksa-class   ksa-class-name ({superclass-name}*) ({slot-specifier}*) {class-option}* => new-ksa-class[Macro]

Define or redefine a ksa class.

Package   :agenda-shell

Module   :agenda-shell

Arguments and values

ksa-class-name     A non-nil, non-keyword symbol that names the ksa class
superclass-name     A non-nil, non-keyword symbol that specifies a direct superclass of the ksa class ksa-class-name
slot-specifiers     See below
class-options     See below
new-ksa-class     A new or modified ksa class object

The newly defined or modified ksa class object.

The specified superclass-names do not include at least one ksa class name. This error is signaled on class finalization.

Detailed syntax

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]) |
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 |
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 |
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.


class-name     A non-nil, non-keyword symbol that names a class
documentation     A documentation string
initarg-list     An initialization argument list
slot-name     A non-nil, non-keyword symbol
instance-name-comparison-test     One of the four standardized hash table test function names: eq, eql, equal, or equalp (default for classes of metaclass standard-unit-class is eql)

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 ksa.

The :metaclass class-name class option, if specified, must be a subclass of standard-ksa-class. The default metaclass value is also standard-ksa-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 a ksa class, ksa-with-lock, that has an additional slot containing a lock that can be used to synchronize operations on each KSA of that class.

  > (define-ksa-class ksa-with-lock ()
      ((lock :initform (make-lock :name "KSA Lock"))))
  #<standard-ksa-class ksa-with-lock>
Do the same, but with a mixin class:
  > (define-unit-class ksa-lock-mixin ()
      ((lock :initform (make-lock :name "KSA Lock"))))
  #<standard-unit-class ksa-lock-mixin>
  > (define-ksa-class ksa-with-lock (ksa ksa-lock-mixin)
  #<standard-ksa-class ksa-with-lock>

The GBBopen Project

define-ks-classAgenda Control Shelldescribe-ksdefine-ksa-classGoTo Top