![]() | ![]() | ![]() | define-class | ![]() |
| class-name
( {superclass-name}*) ( {slot-specifier}*) | [Macro] |
Purpose
Extended macro for defining or redefining a class.
Package :gbbopen-tools
Module :gbbopen-tools
Arguments and values
class-name | A non-nil , non-keyword symbol that names the
class
| |
superclass-name | A non-nil , non-keyword symbol that specifies a
direct superclass of the class | |
slot-specifiers | See below | |
class-options | See below | |
new-class | A new or modified class object |
Returns
The newly defined or modified class object.
Detailed syntax
| slot-name | |
( slot-name [[slot-option]]) | |
| {:accessor reader-function-name}* | |
{:allocation allocation-type} | | |
{:documentation string} | | |
{:initarg initarg-name}* | | |
{:initform form} | | |
{:reader reader-function-name}* | | |
{:type type-specifier} | | |
{:writer writer-function-name}* | |
| (:default-initargs . initarg-list) | |
(:documentation string) | | |
(:export-accessors boolean) | | |
(:export-class-name boolean) | | |
(:export-slot-names slots-specifier) | | |
(:generate-accessors slots-specifier) | | |
(:generate-accessors-format
{:prefix | :suffix } | | |
(:generate-accessors-prefix {string |
symbol}) | | |
(:generate-accessors-suffix {string |
symbol}) | | |
(:generate-initargs slots-specifier) | | |
(:metaclass class-name) | |
| nil | t |
included-slot-name* | |
{t :exclude excluded-slot-name*} | |
Terms
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
|
Description
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 standard-object
The :metaclass
class option, if specified, must be a subclass
of standard-class
standard-class
See also
define-unit-class
make-instance
with-generate-accessors-format
Examples
Define a class, rectangle
-of
”
slot accessors:
> (define-class rectangle (point) (length width)) #<standard-class rectangle> >
Define a class, foo
, generating
.
slot-name”
> (define-class foo () ((slot :initform ':uninitialized)) (:generate-accessors-format :prefix)) #<standard-class foo> >
The GBBopen Project
![]() | ![]() | ![]() | define-class | ![]() |