The slot-extra-options Reference Manual

This is the slot-extra-options Reference Manual, version 1.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 17:54:26 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 slot-extra-options

Extra options for slots using MOP.

Author

Dmitrii Korobeinikov <>

Home Page

https://github.com/some-mthfka/slot-extra-options

License

LGPL-3.0-or-later

Version

1.1.0

Dependencies
  • alexandria (system).
  • closer-mop (system).
  • serapeum (system).
  • iterate (system).
Source

slot-extra-options.asd.

Child Components

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


3.1 Lisp


3.1.1 slot-extra-options/slot-extra-options.asd

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

ASDF Systems

slot-extra-options.


3.1.2 slot-extra-options/package.lisp

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Packages

slot-extra-options.


3.1.3 slot-extra-options/utils.lisp

Dependency

package.lisp (file).

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Public Interface
Internals

3.1.4 slot-extra-options/error-conditions.lisp

Dependency

utils.lisp (file).

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Public Interface

slot-extra-options-error (condition).

Internals

message (reader method).


3.1.5 slot-extra-options/coalesce.lisp

Dependency

error-conditions.lisp (file).

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Public Interface

coalesce-options (generic function).


3.1.6 slot-extra-options/slot-extra-options.lisp

Dependency

coalesce.lisp (file).

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Public Interface
Internals

3.1.7 slot-extra-options/macro.lisp

Dependency

slot-extra-options.lisp (file).

Source

slot-extra-options.asd.

Parent Component

slot-extra-options (system).

Public Interface

def-extra-options-metaclass (macro).


4 Packages

Packages are listed by definition order.


4.1 slot-extra-options

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


5.1 Public Interface


5.1.1 Macros

Macro: def-extra-options-metaclass (name direct-superclasses option-definitions &rest defclass-options)

Define metaclass NAME from OPTION-DEFINITIONS while inheriting from DIRECT-SUPERCLASSES and ‘slot-extra-options-class’. OPTION-DEFINITIONS are used to construct ‘slot-option’s. The format for an option definition is (name [:initform <initform>] [:coalescence <rule specializer>] [:type <type of option>]). The custom options you define may be easily inspected (after the class has been finalized) just like regular options (aka ‘slot-definition-initform’): with slot-definition-<option-name>, which yields the desired ‘slot-option’. Slot options may have custom inheritence rules - see ‘coalesce-options’ for details.

Package

slot-extra-options.

Source

macro.lisp.


5.1.2 Ordinary functions

Function: all-direct-slot-definitions (class slot-name)

Get all slot definition of SLOT-NAME in the precedence list of CLASS, ordered as they come in the precedence list. CLASS must be finalized.

Package

slot-extra-options.

Source

utils.lisp.

Function: all-slot-readers (class slot-name)

All slot readers gathered from the direct definitions of the precedence list of CLASS. CLASS must be finalized.

Package

slot-extra-options.

Source

utils.lisp.

Function: all-slot-writers (class slot-name)

All slot writers gathered from the direct definitions of the precedence list of CLASS. CLASS must be finalized.

Package

slot-extra-options.

Source

utils.lisp.

Function: ensure-finalized-precedence (class)

Finalize the class and all classes in its precedence list.

Package

slot-extra-options.

Source

utils.lisp.

Function: ensure-option-in-slot-def (slot-def key &optional default)

Ensure that key is present in slot definition SLOT-DEF, and, if not, place it there with DEFAULT. Or error if default is not supplied.

Package

slot-extra-options.

Source

utils.lisp.

Function: find-dslot (slot-name class-or-class-name)

Find direct slot named SLOT-NAME in CLASS-OR-CLASS-NAME.

Package

slot-extra-options.

Source

utils.lisp.

Function: find-slot (slot-name class-or-class-name)

Find effective slot named SLOT-NAME in CLASS-OR-CLASS-NAME.

Package

slot-extra-options.

Source

utils.lisp.

Function: pick-in-slot-def (slot-def key)

Return a list of all options specified by KEY in the slot definition SLOT-DEF, ordered as they come in there. Example: (pick-in-slot-def ’(zulu :initform 0 :reader z0 :reader z1) :reader) => (z0 z1).

Package

slot-extra-options.

Source

utils.lisp.

Function: pick-in-slot-defs (slot-defs key)

Return a list of all options specified by KEY in SLOT-DEFS. See ‘pick-in-slot-def’.

Package

slot-extra-options.

Source

utils.lisp.

Function: remove-from-slot-def (slot-def &rest keys)

Remove all options specified by KEY from slot definition SLOT-DEF.

Package

slot-extra-options.

Source

utils.lisp.

Function: slot-exists-and-bound-p (object slot-name)
Package

slot-extra-options.

Source

utils.lisp.

Function: slot-option-direct-changed-p (class slot-name option-name option-accessor &key eq-comp)

Find the first class in the ‘rest’ of ‘class-precedence-list’
where SLOT-NAME exists, and then, if option OPTION-NAME exists, compare it with
the option OPTION-NAME of SLOT-NAME of CLASS using equality predicate EQ-COMP
(if both are unbound, nil is returned). If option doesn’t not exist, or there
are no SLOT-NAME slots, return t. In this version of the function, the direct slots are examined.

Package

slot-extra-options.

Source

utils.lisp.

Function: slot-option-effective-changed-p (class slot-name option-name option-accessor &key eq-comp)

Find the first class in the ‘rest’ of ‘class-precedence-list’
where SLOT-NAME exists, and then, if option OPTION-NAME exists, compare it with
the option OPTION-NAME of SLOT-NAME of CLASS using equality predicate EQ-COMP
(if both are unbound, nil is returned). If option doesn’t not exist, or there
are no SLOT-NAME slots, return t. In this version of the function, the effective slots are examined. Please, ensure that all classes are finalized before calling!

Package

slot-extra-options.

Source

utils.lisp.


5.1.3 Generic functions

Generic Function: coalesce-options (option-name class dslots rule)

Coalesce option OPTION-NAME of CLASS from direct slots
DSLOTS. This lets you define inheritence for custom options (see ‘slot-extra-options-class’). ‘compute-effective-slot-definition’ calls this method for each option in turn and expects (values <new value of the option> <’bind or ’leave-unbound>). To define a custom inheritence rule, you can specialize on RULE (see already existing specializations for examples).

Package

slot-extra-options.

Source

coalesce.lisp.

Methods
Method: coalesce-options (option-name class dslots (rule (eql slot-extra-options:bound-only-once)))

Ensure that a value is bound only once in the whole inheritence line. Subclasses inherit that value (and cannot override it, getting an error).

Method: coalesce-options (option-name class dslots (rule (eql slot-extra-options:difference)))

Set difference of first dslot’s OPTION from the rest of DSLOTS, removing duplicates. Lists only (unbound treated as NIL).

Method: coalesce-options (option-name class dslots (rule (eql merge)))

Merge option OPTION-NAME of all DSLOTS. Lists only (unbound treated as NIL).

Method: coalesce-options (option-name class dslots (rule (eql slot-extra-options:replace-or-inherit)))

Inherit option OPTION-NAME from the first of DSLOTS where it’s bound.

Generic Reader: coalescence (object)
Package

slot-extra-options.

Methods
Reader Method: coalescence ((slot-option slot-option))

automatically generated reader method

Source

slot-extra-options.lisp.

Target Slot

coalescence.

Generic Writer: (setf coalescence) (object)
Package

slot-extra-options.

Methods
Writer Method: (setf coalescence) ((slot-option slot-option))

automatically generated writer method

Source

slot-extra-options.lisp.

Target Slot

coalescence.

Generic Reader: initform (object)
Package

slot-extra-options.

Methods
Reader Method: initform ((slot-option slot-option))

automatically generated reader method

Source

slot-extra-options.lisp.

Target Slot

initform.

Generic Writer: (setf initform) (object)
Package

slot-extra-options.

Methods
Writer Method: (setf initform) ((slot-option slot-option))

automatically generated writer method

Source

slot-extra-options.lisp.

Target Slot

initform.

Generic Reader: name (object)
Package

slot-extra-options.

Methods
Reader Method: name ((slot-option slot-option))

automatically generated reader method

Source

slot-extra-options.lisp.

Target Slot

name.

Generic Writer: (setf name) (object)
Package

slot-extra-options.

Methods
Writer Method: (setf name) ((slot-option slot-option))

automatically generated writer method

Source

slot-extra-options.lisp.

Target Slot

name.

Generic Reader: option-type (object)
Package

slot-extra-options.

Methods
Reader Method: option-type ((slot-option slot-option))

automatically generated reader method

Source

slot-extra-options.lisp.

Target Slot

option-type.

Generic Writer: (setf option-type) (object)
Package

slot-extra-options.

Methods
Writer Method: (setf option-type) ((slot-option slot-option))

automatically generated writer method

Source

slot-extra-options.lisp.

Target Slot

option-type.

Generic Reader: options (object)
Package

slot-extra-options.

Methods
Reader Method: options ((slot-extra-options-class slot-extra-options-class))

automatically generated reader method

Source

slot-extra-options.lisp.

Target Slot

options.

Generic Writer: (setf options) (object)
Package

slot-extra-options.

Methods
Writer Method: (setf options) ((slot-extra-options-class slot-extra-options-class))

automatically generated writer method

Source

slot-extra-options.lisp.

Target Slot

options.


5.1.4 Standalone methods

Method: compute-effective-slot-definition ((class slot-extra-options-class) slot-name direct-slots)

Coalesce DIRECT-SLOTS and produce a slot with custom options defined in CLASS.

Package

sb-mop.

Source

slot-extra-options.lisp.

Method: validate-superclass ((class slot-extra-options-class) (superclass standard-class))
Package

sb-mop.

Source

slot-extra-options.lisp.


5.1.5 Conditions

Condition: slot-extra-options-error
Package

slot-extra-options.

Source

error-conditions.lisp.

Direct superclasses

error.

Direct methods

message.

Direct slots
Slot: message
Initform

(quote nil)

Initargs

:message

Readers

message.

Writers

This slot is read-only.


5.1.6 Classes

Class: slot-extra-options-class

A metaclass which lets you define new slot options/keywords for classes. See ‘def-extra-options-metaclass’ for usage details.

Package

slot-extra-options.

Source

slot-extra-options.lisp.

Direct superclasses

standard-class.

Direct methods
Direct slots
Slot: options
Allocation

:class

Initargs

:options

Readers

options.

Writers

(setf options).

Class: slot-option

Contains information that defines an option.

Package

slot-extra-options.

Source

slot-extra-options.lisp.

Direct methods
Direct slots
Slot: name
Type

symbol

Initargs

:name

Readers

name.

Writers

(setf name).

Slot: initform
Initargs

:initform

Readers

initform.

Writers

(setf initform).

Slot: option-type
Initargs

:type

Readers

option-type.

Writers

(setf option-type).

Slot: coalescence
Type

symbol

Initargs

:coalescence

Readers

coalescence.

Writers

(setf coalescence).


5.2 Internals


5.2.1 Macros

Macro: def-slot-option-changed-p (name find-slot-f spec)
Package

slot-extra-options.

Source

utils.lisp.

Macro: itr (&rest rest)

Alias for ‘iterate:iterate’.

Package

slot-extra-options.

Source

utils.lisp.


5.2.2 Ordinary functions

Function: make-slot-option (&rest args)
Package

slot-extra-options.

Source

slot-extra-options.lisp.

Function: make-slot-option-from-definition (option-definition)

Make ‘slot-option’ from OPTION-DEFINITION.

Package

slot-extra-options.

Source

slot-extra-options.lisp.

Function: merge-metaclass-options (class new-options)
Package

slot-extra-options.

Source

slot-extra-options.lisp.

Function: merge-slot-options (slot-a slot-b)
Package

slot-extra-options.

Source

slot-extra-options.lisp.

Function: metaclass-options-list-from-inheritence (class new-options)
Package

slot-extra-options.

Source

slot-extra-options.lisp.

Function: remove-from-slot-defs (slot-defs &rest keys)

Remove all options specified by KEY from slot deifinitions SLOT-DEFS. See ‘remove-from-slot-def’.

Package

slot-extra-options.

Source

utils.lisp.

Function: set-slot-option-defaults (slot-option)

Fill in the defaults - setting them in ‘slot-option’ directly will screw up inhertiing them: they need to be unbound for that. Destructive.

Package

slot-extra-options.

Source

slot-extra-options.lisp.


5.2.3 Generic functions

Generic Reader: message (condition)
Package

slot-extra-options.

Methods
Reader Method: message ((condition slot-extra-options-error))
Source

error-conditions.lisp.

Target Slot

message.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   C   D   E   F   G   I   M   N   O   P   R   S   V  
Index Entry  Section

(
(setf coalescence): Public generic functions
(setf coalescence): Public generic functions
(setf initform): Public generic functions
(setf initform): Public generic functions
(setf name): Public generic functions
(setf name): Public generic functions
(setf option-type): Public generic functions
(setf option-type): Public generic functions
(setf options): Public generic functions
(setf options): Public generic functions

A
all-direct-slot-definitions: Public ordinary functions
all-slot-readers: Public ordinary functions
all-slot-writers: Public ordinary functions

C
coalesce-options: Public generic functions
coalesce-options: Public generic functions
coalesce-options: Public generic functions
coalesce-options: Public generic functions
coalesce-options: Public generic functions
coalescence: Public generic functions
coalescence: Public generic functions
compute-effective-slot-definition: Public standalone methods

D
def-extra-options-metaclass: Public macros
def-slot-option-changed-p: Private macros

E
ensure-finalized-precedence: Public ordinary functions
ensure-option-in-slot-def: Public ordinary functions

F
find-dslot: Public ordinary functions
find-slot: Public ordinary functions
Function, all-direct-slot-definitions: Public ordinary functions
Function, all-slot-readers: Public ordinary functions
Function, all-slot-writers: Public ordinary functions
Function, ensure-finalized-precedence: Public ordinary functions
Function, ensure-option-in-slot-def: Public ordinary functions
Function, find-dslot: Public ordinary functions
Function, find-slot: Public ordinary functions
Function, make-slot-option: Private ordinary functions
Function, make-slot-option-from-definition: Private ordinary functions
Function, merge-metaclass-options: Private ordinary functions
Function, merge-slot-options: Private ordinary functions
Function, metaclass-options-list-from-inheritence: Private ordinary functions
Function, pick-in-slot-def: Public ordinary functions
Function, pick-in-slot-defs: Public ordinary functions
Function, remove-from-slot-def: Public ordinary functions
Function, remove-from-slot-defs: Private ordinary functions
Function, set-slot-option-defaults: Private ordinary functions
Function, slot-exists-and-bound-p: Public ordinary functions
Function, slot-option-direct-changed-p: Public ordinary functions
Function, slot-option-effective-changed-p: Public ordinary functions

G
Generic Function, (setf coalescence): Public generic functions
Generic Function, (setf initform): Public generic functions
Generic Function, (setf name): Public generic functions
Generic Function, (setf option-type): Public generic functions
Generic Function, (setf options): Public generic functions
Generic Function, coalesce-options: Public generic functions
Generic Function, coalescence: Public generic functions
Generic Function, initform: Public generic functions
Generic Function, message: Private generic functions
Generic Function, name: Public generic functions
Generic Function, option-type: Public generic functions
Generic Function, options: Public generic functions

I
initform: Public generic functions
initform: Public generic functions
itr: Private macros

M
Macro, def-extra-options-metaclass: Public macros
Macro, def-slot-option-changed-p: Private macros
Macro, itr: Private macros
make-slot-option: Private ordinary functions
make-slot-option-from-definition: Private ordinary functions
merge-metaclass-options: Private ordinary functions
merge-slot-options: Private ordinary functions
message: Private generic functions
message: Private generic functions
metaclass-options-list-from-inheritence: Private ordinary functions
Method, (setf coalescence): Public generic functions
Method, (setf initform): Public generic functions
Method, (setf name): Public generic functions
Method, (setf option-type): Public generic functions
Method, (setf options): Public generic functions
Method, coalesce-options: Public generic functions
Method, coalesce-options: Public generic functions
Method, coalesce-options: Public generic functions
Method, coalesce-options: Public generic functions
Method, coalescence: Public generic functions
Method, compute-effective-slot-definition: Public standalone methods
Method, initform: Public generic functions
Method, message: Private generic functions
Method, name: Public generic functions
Method, option-type: Public generic functions
Method, options: Public generic functions
Method, validate-superclass: Public standalone methods

N
name: Public generic functions
name: Public generic functions

O
option-type: Public generic functions
option-type: Public generic functions
options: Public generic functions
options: Public generic functions

P
pick-in-slot-def: Public ordinary functions
pick-in-slot-defs: Public ordinary functions

R
remove-from-slot-def: Public ordinary functions
remove-from-slot-defs: Private ordinary functions

S
set-slot-option-defaults: Private ordinary functions
slot-exists-and-bound-p: Public ordinary functions
slot-option-direct-changed-p: Public ordinary functions
slot-option-effective-changed-p: Public ordinary functions

V
validate-superclass: Public standalone methods


A.4 Data types

Jump to:   C   E   F   M   P   S   U  
Index Entry  Section

C
Class, slot-extra-options-class: Public classes
Class, slot-option: Public classes
coalesce.lisp: The slot-extra-options/coalesce․lisp file
Condition, slot-extra-options-error: Public conditions

E
error-conditions.lisp: The slot-extra-options/error-conditions․lisp file

F
File, coalesce.lisp: The slot-extra-options/coalesce․lisp file
File, error-conditions.lisp: The slot-extra-options/error-conditions․lisp file
File, macro.lisp: The slot-extra-options/macro․lisp file
File, package.lisp: The slot-extra-options/package․lisp file
File, slot-extra-options.asd: The slot-extra-options/slot-extra-options․asd file
File, slot-extra-options.lisp: The slot-extra-options/slot-extra-options․lisp file
File, utils.lisp: The slot-extra-options/utils․lisp file

M
macro.lisp: The slot-extra-options/macro․lisp file

P
Package, slot-extra-options: The slot-extra-options package
package.lisp: The slot-extra-options/package․lisp file

S
slot-extra-options: The slot-extra-options system
slot-extra-options: The slot-extra-options package
slot-extra-options-class: Public classes
slot-extra-options-error: Public conditions
slot-extra-options.asd: The slot-extra-options/slot-extra-options․asd file
slot-extra-options.lisp: The slot-extra-options/slot-extra-options․lisp file
slot-option: Public classes
System, slot-extra-options: The slot-extra-options system

U
utils.lisp: The slot-extra-options/utils․lisp file