The nclasses Reference Manual

This is the nclasses Reference Manual, version 0.6.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Tue Jul 15 06:04:16 2025 GMT+0.

Table of Contents


1 Systems

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


1.1 nclasses

Simplify class like definitions with define-class and friends.

Maintainer

Atlas Engineer LLC

Author

dwim.hu & Atlas Engineer LLC

Home Page

https://github.com/atlas-engineer/nclasses

Source Control

(GIT https://github.com/atlas-engineer/nclasses.git)

Bug Tracker

https://github.com/atlas-engineer/nclasses/issues

License

Public Domain

Version

0.6.1

Dependency

moptilities (system).

Source

nclasses.asd.

Child Components

2 Files

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


2.1 Lisp


2.1.1 nclasses/nclasses.asd

Source

nclasses.asd.

Parent Component

nclasses (system).

ASDF Systems

nclasses.


2.1.2 nclasses/package.lisp

Source

nclasses.asd.

Parent Component

nclasses (system).

Packages

nclasses.


2.1.3 nclasses/duplicates.lisp

Dependency

package.lisp (file).

Source

nclasses.asd.

Parent Component

nclasses (system).

Internals

2.1.4 nclasses/defclass-star.lisp

Dependency

duplicates.lisp (file).

Source

nclasses.asd.

Parent Component

nclasses (system).

Public Interface
Internals

3 Packages

Packages are listed by definition order.


3.1 nclasses

This library offers four helper macros:
- ‘nclasses:define-class’ (aliases ‘nclasses:define-class*’ and ‘nclasses:defclass*’)
- ‘nclasses:define-condition*’ (alias ‘nclasses:defcondition*’).
- ‘nclasses:define-generic’ (aliases ‘nclasses:define-generic*’ and ‘nclasses:defgeneric*’). - ‘nclasses:make-instance*’ (alias ‘nclasses:make*’ and ‘nclasses:make’).

Compared to the standard macros, they accept extra options and slot definition
is smarter.

Example of ‘nclasses:define-class’:

(define-class foo ()
((slot1 :initarg nil)
(slot2 "hello!")
(unexported-slot :export nil))
(:export-class-name-p t)
(:export-accessor-names-p t)
(:accessor-name-transformer #’nclasses:default-accessor-name-transformer))

In the above, all slot accessors are automatically defined using ‘nclasses:default-accessor-name-transformer’. They are also exported together with the class name.
The initarg default to the keyword version of the slot symbol, unless it’s
explicitly set to NIL.

Notice that the second value of the slot definition, if not an option, is then
the initform.

See ‘nclasses:define-class’ and other macros’ documentation for more details.

Source

package.lisp.

Use List

common-lisp.

Public Interface
Internals

4 Definitions

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


4.1 Public Interface


4.1.1 Special variables

Special Variable: *allowed-slot-definition-properties*

Holds a list of keywords that are allowed in slot definitions (:accessor and :initarg are implicitly included).

Package

nclasses.

Source

defclass-star.lisp.


4.1.2 Macros

Macro: defclass* (name supers slots &rest options)

Convenience wrapper of ‘defclass’.

It automates a lot of boilerplate (like exporting all the accessors of a class)
plus adds some new features.

Slot options:

- The initform can be specified as the second value.

- ‘:accessor’, ‘:reader’ and ‘:writer’ can be set to either a name, NIL or T.
If NIL, the method is not generated.
If T, the method is generated using the ‘:accessor-name-transformer’ class option value.

- The ‘:export’ option allows to control the slot-name export on a per-slot basis.

New class options (defaults are NIL unless specified):

- ‘:slot-definition-transformer’ (default: ‘default-slot-definition-transformer’).
A function that takes a SLOT-DEFINITION and returns a new one.

- ‘:accessor-name-package’: The package of the generated accessors. See ‘:accessor-name-transformer’. Some special values are accepted:
- ‘:slot-name’: The package of the slot-name.
- ‘:default’: The current package.

- ‘:accessor-name-transformer’ (default ‘default-accessor-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol). Other transformer: ‘dwim-accessor-name-transformer’.

- ‘:automatic-accessors-p’: Whether to generate accessor names automatically for
all slots.

As a special case, the accessor is not generated if all following conditions are met: - ‘:accessor-name-package’ is ‘:slot-name’,
- slot name package is different from current package,
- if the ‘:accessor’ slot option is not provided,

- ‘:initarg-name-transformer’ (default: ‘default-initarg-name-transformer’.)

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol.

- ‘:automatic-initargs-p’ (default: T): Whether to generate accessor names automatically for all slots.

- ‘:predicate-name-transformer’ (default: ‘default-predicate-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the predicate
name (a symbol).

- ‘:automatic-predicates-p’ (default: T): Whether to generate a predicate
for the class.

- ‘:type-inference’ (default: ‘default-type-inference’).

Function that returns the type of a slot definition (with an initform). It
takes 3 arguments:

- The initform.
- The slot name.
- The rest of the slot definition.

- ‘:automatic-types-p’: Whether to generate the type automatically for all
slots. The type can still be specified manually with the ‘:type’ slot option.

- Self-explanatory export options (all NIL by default):
- ‘:export-class-name-p’
- ‘:export-accessor-names-p’
- ‘:export-slot-names-p’
- ‘:export-predicate-name’

Package

nclasses.

Alias for

define-class.

Macro: defcondition* (name supers slots &rest options)

To ‘define-condition’ what ‘define-class’ is to ‘defclass’. See ‘define-class’ for more details.

Package

nclasses.

Alias for

define-condition*.

Macro: defgeneric* (name (&rest arglist) &body body)

Convenience macro to define generics as if they were methods.
ARGLIST can be a method arglist, in which case it’s parsed into
generic function arglist by removing method-specific args.

BODY can be a list of ‘defgeneric’ options (processed as-is, even
:method ones) intermixed with other Lisp forms:
- If there’s a docstring as the first form, it’s processed into
:documentation option of ‘defgeneric’.
- If there are non-option forms, they are put together into a separate
:method option under ARGLIST.
- If there’s a ‘declare’ form:
- If it’s generic-friendly (optimize for speed or space), then it’s
put into both generic body and :method body (if any).
- Otherwise it’s only put into :method (creating it if necessary).
- If there’s an ‘:export-generic-name-p’ boolean option, export (T) or
don’t export (NIL) the generic symbol.

Example:

(define-generic add ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys) "Adds A and B, coercing them to fixnum if the sum is too big."
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!")))
=>
(defgeneric add (a b &key &allow-other-keys)
(:method ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys)
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b)))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!"))
(:documentation "Adds A and B, coercing them to fixnum if the sum is too big."))

Package

nclasses.

Alias for

define-generic.

Macro: define-class (name supers slots &rest options)

Convenience wrapper of ‘defclass’.

It automates a lot of boilerplate (like exporting all the accessors of a class)
plus adds some new features.

Slot options:

- The initform can be specified as the second value.

- ‘:accessor’, ‘:reader’ and ‘:writer’ can be set to either a name, NIL or T.
If NIL, the method is not generated.
If T, the method is generated using the ‘:accessor-name-transformer’ class option value.

- The ‘:export’ option allows to control the slot-name export on a per-slot basis.

New class options (defaults are NIL unless specified):

- ‘:slot-definition-transformer’ (default: ‘default-slot-definition-transformer’).
A function that takes a SLOT-DEFINITION and returns a new one.

- ‘:accessor-name-package’: The package of the generated accessors. See ‘:accessor-name-transformer’. Some special values are accepted:
- ‘:slot-name’: The package of the slot-name.
- ‘:default’: The current package.

- ‘:accessor-name-transformer’ (default ‘default-accessor-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol). Other transformer: ‘dwim-accessor-name-transformer’.

- ‘:automatic-accessors-p’: Whether to generate accessor names automatically for
all slots.

As a special case, the accessor is not generated if all following conditions are met: - ‘:accessor-name-package’ is ‘:slot-name’,
- slot name package is different from current package,
- if the ‘:accessor’ slot option is not provided,

- ‘:initarg-name-transformer’ (default: ‘default-initarg-name-transformer’.)

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol.

- ‘:automatic-initargs-p’ (default: T): Whether to generate accessor names automatically for all slots.

- ‘:predicate-name-transformer’ (default: ‘default-predicate-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the predicate
name (a symbol).

- ‘:automatic-predicates-p’ (default: T): Whether to generate a predicate
for the class.

- ‘:type-inference’ (default: ‘default-type-inference’).

Function that returns the type of a slot definition (with an initform). It
takes 3 arguments:

- The initform.
- The slot name.
- The rest of the slot definition.

- ‘:automatic-types-p’: Whether to generate the type automatically for all
slots. The type can still be specified manually with the ‘:type’ slot option.

- Self-explanatory export options (all NIL by default):
- ‘:export-class-name-p’
- ‘:export-accessor-names-p’
- ‘:export-slot-names-p’
- ‘:export-predicate-name’

Package

nclasses.

Source

defclass-star.lisp.

Macro: define-condition* (name supers slots &rest options)

To ‘define-condition’ what ‘define-class’ is to ‘defclass’. See ‘define-class’ for more details.

Package

nclasses.

Source

defclass-star.lisp.

Macro: define-generic (name (&rest arglist) &body body)

Convenience macro to define generics as if they were methods.
ARGLIST can be a method arglist, in which case it’s parsed into
generic function arglist by removing method-specific args.

BODY can be a list of ‘defgeneric’ options (processed as-is, even
:method ones) intermixed with other Lisp forms:
- If there’s a docstring as the first form, it’s processed into
:documentation option of ‘defgeneric’.
- If there are non-option forms, they are put together into a separate
:method option under ARGLIST.
- If there’s a ‘declare’ form:
- If it’s generic-friendly (optimize for speed or space), then it’s
put into both generic body and :method body (if any).
- Otherwise it’s only put into :method (creating it if necessary).
- If there’s an ‘:export-generic-name-p’ boolean option, export (T) or
don’t export (NIL) the generic symbol.

Example:

(define-generic add ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys) "Adds A and B, coercing them to fixnum if the sum is too big."
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!")))
=>
(defgeneric add (a b &key &allow-other-keys)
(:method ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys)
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b)))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!"))
(:documentation "Adds A and B, coercing them to fixnum if the sum is too big."))

Package

nclasses.

Source

defclass-star.lisp.

Macro: define-generic* (name (&rest arglist) &body body)

Convenience macro to define generics as if they were methods.
ARGLIST can be a method arglist, in which case it’s parsed into
generic function arglist by removing method-specific args.

BODY can be a list of ‘defgeneric’ options (processed as-is, even
:method ones) intermixed with other Lisp forms:
- If there’s a docstring as the first form, it’s processed into
:documentation option of ‘defgeneric’.
- If there are non-option forms, they are put together into a separate
:method option under ARGLIST.
- If there’s a ‘declare’ form:
- If it’s generic-friendly (optimize for speed or space), then it’s
put into both generic body and :method body (if any).
- Otherwise it’s only put into :method (creating it if necessary).
- If there’s an ‘:export-generic-name-p’ boolean option, export (T) or
don’t export (NIL) the generic symbol.

Example:

(define-generic add ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys) "Adds A and B, coercing them to fixnum if the sum is too big."
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!")))
=>
(defgeneric add (a b &key &allow-other-keys)
(:method ((a integer) (b integer) &key coerce-to-fixnum &allow-other-keys)
(if coerce-to-fixnum
(coerce (+ a b) ’fixnum)
(+ a b)))
(:method ((a string) (b integer))
(error "Cannot use ‘add’ on strings!"))
(:documentation "Adds A and B, coercing them to fixnum if the sum is too big."))

Package

nclasses.

Alias for

define-generic.

Macro: make (class &rest arguments)

Convenience macro on top of ‘make-instance’.

Conveniences:

- First argument can be a (possibly empty) list of shortcut symbols, which is automatically converted into a KEYWORD+SYMBOL pairs where
- KEYWORD is the same as shortcut name, but interned as keyword.
- And SYMBOL is the same as shortcut.

- The last argument can be an apply argument—arbitrary list-producing form, which will be used as the last argument
to (apply #’make-instance ...) idiom.

Note that using a singular shortcut list of apply argument is an ambiguous case that will be interpreted in favor of apply argument. To force either of interpretations, provide shortcuts and apply arguments explicitly:
(make-instance* ’class (a b c)) ;; BAD
(make-instance* ’class (a b c) nil) ;; GOOD
(make-instance* ’class (when t nil)) ;; BAD
(make-instance* ’class () (when t nil)) ;; GOOD

Otherwise, the behavior is equivalent to ‘make-instance’.

Examples:

Shortcut args:
(make-instance* ’class (a b c))
=>
(make-instance ’class :a a :b b :c c)

Last form converted into ‘apply’ argument:
(make-instance* ’class :c c :b b (when something (list :a a)))
=>
(apply #’make-instance ’class :c c :b b (when something (list :a a)))

Shortcut arguments, regular arguments, and form for ‘apply’: (make-instance* ’class (b c) :x x (when something (list :a a)))
=>
(apply #’make-instance ’class :b b :c c :x x (when something (list :a a)))

Form for ‘apply’ (notice the empty shortcuts—these are required for unambiguous parsing):
(make-instance* ’class () (when something (list :a a)))
=>
(apply #’make-instance ’class (when something (list :a a)))

Regular ‘make-instance’-like use:
(make-instance* ’class :a a-value :b b-value)
=>
(make-instance ’class :a a-value :b b-value)

Package

nclasses.

Alias for

make-instance*.

Macro: make* (class &rest arguments)

Convenience macro on top of ‘make-instance’.

Conveniences:

- First argument can be a (possibly empty) list of shortcut symbols, which is automatically converted into a KEYWORD+SYMBOL pairs where
- KEYWORD is the same as shortcut name, but interned as keyword.
- And SYMBOL is the same as shortcut.

- The last argument can be an apply argument—arbitrary list-producing form, which will be used as the last argument
to (apply #’make-instance ...) idiom.

Note that using a singular shortcut list of apply argument is an ambiguous case that will be interpreted in favor of apply argument. To force either of interpretations, provide shortcuts and apply arguments explicitly:
(make-instance* ’class (a b c)) ;; BAD
(make-instance* ’class (a b c) nil) ;; GOOD
(make-instance* ’class (when t nil)) ;; BAD
(make-instance* ’class () (when t nil)) ;; GOOD

Otherwise, the behavior is equivalent to ‘make-instance’.

Examples:

Shortcut args:
(make-instance* ’class (a b c))
=>
(make-instance ’class :a a :b b :c c)

Last form converted into ‘apply’ argument:
(make-instance* ’class :c c :b b (when something (list :a a)))
=>
(apply #’make-instance ’class :c c :b b (when something (list :a a)))

Shortcut arguments, regular arguments, and form for ‘apply’: (make-instance* ’class (b c) :x x (when something (list :a a)))
=>
(apply #’make-instance ’class :b b :c c :x x (when something (list :a a)))

Form for ‘apply’ (notice the empty shortcuts—these are required for unambiguous parsing):
(make-instance* ’class () (when something (list :a a)))
=>
(apply #’make-instance ’class (when something (list :a a)))

Regular ‘make-instance’-like use:
(make-instance* ’class :a a-value :b b-value)
=>
(make-instance ’class :a a-value :b b-value)

Package

nclasses.

Alias for

make-instance*.

Macro: make-instance* (class &rest arguments)

Convenience macro on top of ‘make-instance’.

Conveniences:

- First argument can be a (possibly empty) list of shortcut symbols, which is automatically converted into a KEYWORD+SYMBOL pairs where
- KEYWORD is the same as shortcut name, but interned as keyword.
- And SYMBOL is the same as shortcut.

- The last argument can be an apply argument—arbitrary list-producing form, which will be used as the last argument
to (apply #’make-instance ...) idiom.

Note that using a singular shortcut list of apply argument is an ambiguous case that will be interpreted in favor of apply argument. To force either of interpretations, provide shortcuts and apply arguments explicitly:
(make-instance* ’class (a b c)) ;; BAD
(make-instance* ’class (a b c) nil) ;; GOOD
(make-instance* ’class (when t nil)) ;; BAD
(make-instance* ’class () (when t nil)) ;; GOOD

Otherwise, the behavior is equivalent to ‘make-instance’.

Examples:

Shortcut args:
(make-instance* ’class (a b c))
=>
(make-instance ’class :a a :b b :c c)

Last form converted into ‘apply’ argument:
(make-instance* ’class :c c :b b (when something (list :a a)))
=>
(apply #’make-instance ’class :c c :b b (when something (list :a a)))

Shortcut arguments, regular arguments, and form for ‘apply’: (make-instance* ’class (b c) :x x (when something (list :a a)))
=>
(apply #’make-instance ’class :b b :c c :x x (when something (list :a a)))

Form for ‘apply’ (notice the empty shortcuts—these are required for unambiguous parsing):
(make-instance* ’class () (when something (list :a a)))
=>
(apply #’make-instance ’class (when something (list :a a)))

Regular ‘make-instance’-like use:
(make-instance* ’class :a a-value :b b-value)
=>
(make-instance ’class :a a-value :b b-value)

Package

nclasses.

Source

defclass-star.lisp.

Macro: make-name-transformer (&rest elements)

Return an accessor name transformer.
The unquoted ‘name’ symbol argument is substituted for the slot name. Class option examples:

:accessor-name-transformer (make-name-transformer "FOO-" name "-BAR")

Use the slot name directly:

:accessor-name-transformer (make-name-transformer name)

Package

nclasses.

Source

defclass-star.lisp.


4.1.3 Ordinary functions

Function: always-dashed-predicate-name-transformer (name &rest args)

Return predicate name that’s always suffixed with ’-p’.

Package

nclasses.

Source

defclass-star.lisp.

Function: default-accessor-name-transformer (name definition)

Return an accessor name following the slot name NAME.

Package

nclasses.

Source

defclass-star.lisp.

Function: default-initarg-name-transformer (name definition)

Converts the symbol to a keyword with the same name.

Package

nclasses.

Source

defclass-star.lisp.

Function: default-predicate-name-transformer (name &rest args)

Return predicate name that’s suffixed with ’-p’ if NAME already contains a ’-’, or just ’p’ otherwise..

Package

nclasses.

Source

defclass-star.lisp.

Function: default-slot-definition-transformer (slot-def)

Converts illegal (list foo) :type declarations into simple list declarations.

Package

nclasses.

Source

defclass-star.lisp.

Function: default-type-inference (initform name definition)

Return type of INITFORM.
This is like ‘type-of’ but returns less specialized types for some common subtypes, e.g. for "" return ’string instead of ‘(SIMPLE-ARRAY CHARACTER (0))’.

Note that in a slot definition, ’() is inferred to be a list while NIL is inferred to be a boolean.

If the slot is found in a finalized superclass, the inferred type is then that of the superclass. If some superclass is not finalized, no type inference is performed.

Non-basic form types are not inferred (returns nil).
Non-basic scalar types are derived to their own type (with ‘type-of’).

Package

nclasses.

Source

defclass-star.lisp.

Function: dwim-accessor-name-transformer (name definition)

Return an accessor name using the slot name NAME suffixed with "-OF".
If the slot is a boolean not ending with a question mark, it is suffixed with "-P" instead. If the slot ends with a question mark, the name is taken as is.

Package

nclasses.

Source

defclass-star.lisp.

Function: question-mark-accessor-name-transformer (name definition)

Return an accessor name using the slot name NAME suffixed with "-OF". If the slot is a boolean, it ensures the name is suffixed with "?".

Package

nclasses.

Source

defclass-star.lisp.

Function: question-mark-predicate-name-transformer (name &rest args)

Return predicate name that’s always suffixed with ’?’.

Package

nclasses.

Source

defclass-star.lisp.


4.2 Internals


4.2.1 Special variables

Special Variable: *accessor-name-package*

A package, or :slot-name means the home-package of the slot-name symbol and nil means *package*

Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *accessor-name-transformer*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *accessor-names*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *automatic-accessors-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *automatic-initargs-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *automatic-predicates-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *automatic-types-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *export-accessor-names-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *export-class-name-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *export-generic-name-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *export-predicate-name-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *export-slot-names-p*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *initarg-name-transformer*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *predicate-name-transformer*

A function that takes the class name and its definition as argument.
Return the name of the predicate function.
The predicate function returns true when the argument is a type of the ‘name’ class.

Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *slot-definition-transformer*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *slot-names*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *symbols-to-export*
Package

nclasses.

Source

defclass-star.lisp.

Special Variable: *type-inference*

Function that returns the type of a slot definition (with an initform). It takes 3 arguments:
- The initform.
- The slot name.
- The rest of the slot definition.

Package

nclasses.

Source

defclass-star.lisp.


4.2.2 Macros

Macro: define-class* (name supers slots &rest options)

Convenience wrapper of ‘defclass’.

It automates a lot of boilerplate (like exporting all the accessors of a class)
plus adds some new features.

Slot options:

- The initform can be specified as the second value.

- ‘:accessor’, ‘:reader’ and ‘:writer’ can be set to either a name, NIL or T.
If NIL, the method is not generated.
If T, the method is generated using the ‘:accessor-name-transformer’ class option value.

- The ‘:export’ option allows to control the slot-name export on a per-slot basis.

New class options (defaults are NIL unless specified):

- ‘:slot-definition-transformer’ (default: ‘default-slot-definition-transformer’).
A function that takes a SLOT-DEFINITION and returns a new one.

- ‘:accessor-name-package’: The package of the generated accessors. See ‘:accessor-name-transformer’. Some special values are accepted:
- ‘:slot-name’: The package of the slot-name.
- ‘:default’: The current package.

- ‘:accessor-name-transformer’ (default ‘default-accessor-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol). Other transformer: ‘dwim-accessor-name-transformer’.

- ‘:automatic-accessors-p’: Whether to generate accessor names automatically for
all slots.

As a special case, the accessor is not generated if all following conditions are met: - ‘:accessor-name-package’ is ‘:slot-name’,
- slot name package is different from current package,
- if the ‘:accessor’ slot option is not provided,

- ‘:initarg-name-transformer’ (default: ‘default-initarg-name-transformer’.)

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the accessor
name (a symbol.

- ‘:automatic-initargs-p’ (default: T): Whether to generate accessor names automatically for all slots.

- ‘:predicate-name-transformer’ (default: ‘default-predicate-name-transformer’).

A function of (SLOT-NAME SLOT-DEFINITION) arguments that returns the predicate
name (a symbol).

- ‘:automatic-predicates-p’ (default: T): Whether to generate a predicate
for the class.

- ‘:type-inference’ (default: ‘default-type-inference’).

Function that returns the type of a slot definition (with an initform). It
takes 3 arguments:

- The initform.
- The slot name.
- The rest of the slot definition.

- ‘:automatic-types-p’: Whether to generate the type automatically for all
slots. The type can still be specified manually with the ‘:type’ slot option.

- Self-explanatory export options (all NIL by default):
- ‘:export-class-name-p’
- ‘:export-accessor-names-p’
- ‘:export-slot-names-p’
- ‘:export-predicate-name’

Package

nclasses.

Alias for

define-class.

Macro: remf-keywords (place &rest keywords)

Removes the properties identified by KEYWORDS from PLACE.

Package

nclasses.

Source

duplicates.lisp.


4.2.3 Ordinary functions

Function: build-defclass-like-expansion (name supers slots options expansion-builder)
Package

nclasses.

Source

defclass-star.lisp.

Function: concatenate-symbol (&rest args)

Args are processed as parts of the result symbol with two exceptions except when a package is encountered then it is stored as the target package at intern.

Package

nclasses.

Source

duplicates.lisp.

Function: extract-options-into-bindings (options)
Package

nclasses.

Source

defclass-star.lisp.

Function: fully-qualified-symbol-name (symbol &key separator)
Package

nclasses.

Source

duplicates.lisp.

Function: generalize-arglist (arglist)

Generalizes ARGLIST to be accepted by ‘defgeneric’ (3.4.2 of CLCS/CLHS). Removes all the default forms or specializers and removes all keyword arguments if &allow-other-keys is present.

Package

nclasses.

Source

defclass-star.lisp.

Function: process-slot-definition (definition &key superclasses)
Package

nclasses.

Source

defclass-star.lisp.

Function: remove-keywords (plist &rest keywords)

Creates a copy of PLIST without the listed KEYWORDS.

Package

nclasses.

Source

duplicates.lisp.

Function: slot-name-package (name)
Package

nclasses.

Source

defclass-star.lisp.

Function: slot-type-maybe-inherited (initform slot-name definition superclasses)
Package

nclasses.

Source

defclass-star.lisp.

Function: style-warn (datum &rest args)
Package

nclasses.

Source

defclass-star.lisp.


4.2.4 Conditions

Condition: hu.dwim.defclass-star-style-warning
Package

nclasses.

Source

defclass-star.lisp.

Direct superclasses
  • simple-condition.
  • style-warning.

Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   A   B   C   D   E   F   G   M   P   Q   R   S  
Index Entry  Section

A
always-dashed-predicate-name-transformer: Public ordinary functions

B
build-defclass-like-expansion: Private ordinary functions

C
concatenate-symbol: Private ordinary functions

D
default-accessor-name-transformer: Public ordinary functions
default-initarg-name-transformer: Public ordinary functions
default-predicate-name-transformer: Public ordinary functions
default-slot-definition-transformer: Public ordinary functions
default-type-inference: Public ordinary functions
defclass*: Public macros
defcondition*: Public macros
defgeneric*: Public macros
define-class: Public macros
define-class*: Private macros
define-condition*: Public macros
define-generic: Public macros
define-generic*: Public macros
dwim-accessor-name-transformer: Public ordinary functions

E
extract-options-into-bindings: Private ordinary functions

F
fully-qualified-symbol-name: Private ordinary functions
Function, always-dashed-predicate-name-transformer: Public ordinary functions
Function, build-defclass-like-expansion: Private ordinary functions
Function, concatenate-symbol: Private ordinary functions
Function, default-accessor-name-transformer: Public ordinary functions
Function, default-initarg-name-transformer: Public ordinary functions
Function, default-predicate-name-transformer: Public ordinary functions
Function, default-slot-definition-transformer: Public ordinary functions
Function, default-type-inference: Public ordinary functions
Function, dwim-accessor-name-transformer: Public ordinary functions
Function, extract-options-into-bindings: Private ordinary functions
Function, fully-qualified-symbol-name: Private ordinary functions
Function, generalize-arglist: Private ordinary functions
Function, process-slot-definition: Private ordinary functions
Function, question-mark-accessor-name-transformer: Public ordinary functions
Function, question-mark-predicate-name-transformer: Public ordinary functions
Function, remove-keywords: Private ordinary functions
Function, slot-name-package: Private ordinary functions
Function, slot-type-maybe-inherited: Private ordinary functions
Function, style-warn: Private ordinary functions

G
generalize-arglist: Private ordinary functions

M
Macro, defclass*: Public macros
Macro, defcondition*: Public macros
Macro, defgeneric*: Public macros
Macro, define-class: Public macros
Macro, define-class*: Private macros
Macro, define-condition*: Public macros
Macro, define-generic: Public macros
Macro, define-generic*: Public macros
Macro, make: Public macros
Macro, make*: Public macros
Macro, make-instance*: Public macros
Macro, make-name-transformer: Public macros
Macro, remf-keywords: Private macros
make: Public macros
make*: Public macros
make-instance*: Public macros
make-name-transformer: Public macros

P
process-slot-definition: Private ordinary functions

Q
question-mark-accessor-name-transformer: Public ordinary functions
question-mark-predicate-name-transformer: Public ordinary functions

R
remf-keywords: Private macros
remove-keywords: Private ordinary functions

S
slot-name-package: Private ordinary functions
slot-type-maybe-inherited: Private ordinary functions
style-warn: Private ordinary functions


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*accessor-name-package*: Private special variables
*accessor-name-transformer*: Private special variables
*accessor-names*: Private special variables
*allowed-slot-definition-properties*: Public special variables
*automatic-accessors-p*: Private special variables
*automatic-initargs-p*: Private special variables
*automatic-predicates-p*: Private special variables
*automatic-types-p*: Private special variables
*export-accessor-names-p*: Private special variables
*export-class-name-p*: Private special variables
*export-generic-name-p*: Private special variables
*export-predicate-name-p*: Private special variables
*export-slot-names-p*: Private special variables
*initarg-name-transformer*: Private special variables
*predicate-name-transformer*: Private special variables
*slot-definition-transformer*: Private special variables
*slot-names*: Private special variables
*symbols-to-export*: Private special variables
*type-inference*: Private special variables

S
Special Variable, *accessor-name-package*: Private special variables
Special Variable, *accessor-name-transformer*: Private special variables
Special Variable, *accessor-names*: Private special variables
Special Variable, *allowed-slot-definition-properties*: Public special variables
Special Variable, *automatic-accessors-p*: Private special variables
Special Variable, *automatic-initargs-p*: Private special variables
Special Variable, *automatic-predicates-p*: Private special variables
Special Variable, *automatic-types-p*: Private special variables
Special Variable, *export-accessor-names-p*: Private special variables
Special Variable, *export-class-name-p*: Private special variables
Special Variable, *export-generic-name-p*: Private special variables
Special Variable, *export-predicate-name-p*: Private special variables
Special Variable, *export-slot-names-p*: Private special variables
Special Variable, *initarg-name-transformer*: Private special variables
Special Variable, *predicate-name-transformer*: Private special variables
Special Variable, *slot-definition-transformer*: Private special variables
Special Variable, *slot-names*: Private special variables
Special Variable, *symbols-to-export*: Private special variables
Special Variable, *type-inference*: Private special variables