Package class-options
Description
All symbols from this package should normally be explicitly qualified, such as class-options:class.
Don't (:use)!
class-options provides easy access to the defining class and its options
during initialization or reinitialization of its subcomponents.
All symbols from this package should normally be explicitly qualified, such as class-options:class.
Don't (:use)!
Simply inherit from this class, then you can easily retrieve the class during initialization or reinitialization by calling class-options:class.
(class class-options:class-mixin) &key => class
Binds class as the value of an internal special variable, then calls the next method.
Call class-options:class to retrieve class.
(class class-options:class-mixin) &key => class
Behaves the same as the above method.
=> defining-class
If a class that inherits from class-options:class-mixin is currently being defined or redefined, then return that class.
Else, (error 'class-options:read-error :reader 'class-options:class :required-mixin 'class-options:class-mixin).
Simply inherit from this class, then you can easily retrieve the canonicalized class options during initialization or reinitialization by calling class-options:options.
(class class-options:options-mixin) &key => class
Binds the result of calling (apply #' as the value of an internal special variable, then calls the next method with class and canonicalized-options.class-options:canonicalize-options class options)
During the call to class-options:canonicalize-options, class-options:operation can be called to determine if we are defining or redefining the class, regardless of if class inherits from class-options:operation-mixin or not.
Call class-options:options to retrieve canonicalized-options.
(class class-options:options-mixin) &key => class
Behaves the same as the above method, of course using reinitialize-instance as the class-options:operation.
=> defining-class
If a class that inherits from class-options:options-mixin is currently being defined or redefined, then return the canonicalized options for that class.
Else, (error 'class-options:read-error :reader 'class-options:options :required-mixin 'class-options:options-mixin).
class &rest options &key &allow-other-keys => canonicalized-options
Canonicalizes options for class, which is its initargs.
(class class) &rest options => options
Returns options.
Simply inherit from this class, then you can easily figure out if the class is being defined or redefined by calling class-options:operation.
(class class-options:operation-mixin) &key => class
Binds the symbol initialize-instance as the value of an internal special variable, then calls the next method.
Call class-options:operation to retrieve the symbol.
(class class-options:operation-mixin) &key => class
Behaves the same as the above method, except the symbol reinitialize-instance is used.
=> operation
initialize-instance or reinitialize-instance.If a class that inherits from class-options:operation-mixin is currently being defined or redefined,
or class-options:canonicalize-options is being called during initialization or reinitialization of a class-options:options-mixin,
then return the symbol initialize-instance or reinitialize-instance, respectively.
Else, (error 'class-options:read-error :reader 'class-options:operation :required-mixin 'class-options:operation-mixin).
Slots:
((reader :initarg :reader
:reader class-options:reader
:type symbol
:documentation "Names the reader function that was called.")
(required-mixin :initarg :required-mixin
:reader class-options:required-mixin
:type symbol
:documentation "Names the mixin that the class should inherit from
for the reader function that was called to return the requested information."))
The consequences are undefined if the :reader or :required-mixin initargs are unsupplied.
object => reader-name
See above.
object => mixin-name
See above.