The defvariant Reference Manual

This is the defvariant Reference Manual, version 1.1, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:58:09 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 defvariant

Variants in Common Lisp.

Author

Frederic Peschanski (format nil

License

BSD 2-Clause. See LICENSE.

Version

1.1

Source

defvariant.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 defvariant/defvariant.asd

Source

defvariant.asd.

Parent Component

defvariant (system).

ASDF Systems

defvariant.


3.1.2 defvariant/package.lisp

Source

defvariant.asd.

Parent Component

defvariant (system).

Packages

defvariant.


3.1.3 defvariant/defvariant.lisp

Dependency

package.lisp (file).

Source

defvariant.asd.

Parent Component

defvariant (system).

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 defvariant

Source

package.lisp.

Nickname

variant

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: defvariant (variant &body variant-cases)
Package

defvariant.

Source

defvariant.lisp.


5.1.2 Generic functions

Generic Reader: match-error-message (condition)
Package

defvariant.

Methods
Reader Method: match-error-message ((condition match-error))
Source

defvariant.lisp.

Target Slot

message.


5.1.3 Conditions

Condition: match-error
Package

defvariant.

Source

defvariant.lisp.

Direct superclasses

error.

Direct methods

match-error-message.

Direct slots
Slot: message
Initargs

:message

Readers

match-error-message.

Writers

This slot is read-only.


5.2 Internals


5.2.1 Special variables

Special Variable: *example-enabled*

Parameter for enabling/disabling
the ‘EXAMPLE‘ macro. Use NIL in production code.

Package

defvariant.

Source

defvariant.lisp.


5.2.2 Macros

Macro: example (expr arrow expected &key eq? warn-only)

Show an evaluation example, useful for documentation and lightweight testing.

(example ‘EXPR‘ => ‘EXPECTED‘) evaluates ‘EXPR‘ and compare, wrt. ‘EQ?‘ (EQUAL by default) to ‘EXPECTED‘ and raise an error if inequal.

Set ‘WARN-ONLY‘ to T for warning instead of error.

Package

defvariant.

Source

defvariant.lisp.

Macro: lets (binders expr &body body)

An abbreviation for MULTIPLE-VALUE-BIND.

Package

defvariant.

Source

defvariant.lisp.


5.2.3 Ordinary functions

Function: build-case-slots (case-id variant-cases)
Package

defvariant.

Source

defvariant.lisp.

Function: build-case-struct (variant case-lbl opts case-vals)
Package

defvariant.

Source

defvariant.lisp.

Function: build-condition (variant case-id val)
Package

defvariant.

Source

defvariant.lisp.

Function: build-dispatch (variant variant-cases match-cases val)
Package

defvariant.

Source

defvariant.lisp.

Function: build-lambda-parameters (params body)
Package

defvariant.

Source

defvariant.lisp.

Function: build-match-args (variant case case-slots val)
Package

defvariant.

Source

defvariant.lisp.

Function: build-match-function (case-spec)
Package

defvariant.

Source

defvariant.lisp.

Function: build-match-macro (variant variant-cases)
Package

defvariant.

Source

defvariant.lisp.

Function: build-structs (variant opts cases)
Package

defvariant.

Source

defvariant.lisp.

Function: build-type-struct (variant opts)
Package

defvariant.

Source

defvariant.lisp.

Function: stringify (&rest args)

Converts to a string and append all ‘ARGS‘.

Package

defvariant.

Source

defvariant.lisp.

Function: symbolize (&rest args)

Converts to a string, append and create a symbol from the result.

Package

defvariant.

Source

defvariant.lisp.


5.2.4 Generic functions

Generic Reader: match-warning-message (condition)
Package

defvariant.

Methods
Reader Method: match-warning-message ((condition match-warning))
Source

defvariant.lisp.

Target Slot

message.


5.2.5 Conditions

Condition: match-warning
Package

defvariant.

Source

defvariant.lisp.

Direct superclasses

warning.

Direct methods

match-warning-message.

Direct slots
Slot: message
Initargs

:message

Readers

match-warning-message.

Writers

This slot is read-only.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   B   D   E   F   G   L   M   S  
Index Entry  Section

B
build-case-slots: Private ordinary functions
build-case-struct: Private ordinary functions
build-condition: Private ordinary functions
build-dispatch: Private ordinary functions
build-lambda-parameters: Private ordinary functions
build-match-args: Private ordinary functions
build-match-function: Private ordinary functions
build-match-macro: Private ordinary functions
build-structs: Private ordinary functions
build-type-struct: Private ordinary functions

D
defvariant: Public macros

E
example: Private macros

F
Function, build-case-slots: Private ordinary functions
Function, build-case-struct: Private ordinary functions
Function, build-condition: Private ordinary functions
Function, build-dispatch: Private ordinary functions
Function, build-lambda-parameters: Private ordinary functions
Function, build-match-args: Private ordinary functions
Function, build-match-function: Private ordinary functions
Function, build-match-macro: Private ordinary functions
Function, build-structs: Private ordinary functions
Function, build-type-struct: Private ordinary functions
Function, stringify: Private ordinary functions
Function, symbolize: Private ordinary functions

G
Generic Function, match-error-message: Public generic functions
Generic Function, match-warning-message: Private generic functions

L
lets: Private macros

M
Macro, defvariant: Public macros
Macro, example: Private macros
Macro, lets: Private macros
match-error-message: Public generic functions
match-error-message: Public generic functions
match-warning-message: Private generic functions
match-warning-message: Private generic functions
Method, match-error-message: Public generic functions
Method, match-warning-message: Private generic functions

S
stringify: Private ordinary functions
symbolize: Private ordinary functions