The defvariant Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The defvariant Reference Manual

This is the defvariant Reference Manual, version 1.1, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 03:48:16 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

defvariant

Variants for Common Lisp (for ML nostalgics ?)

(defpackage :try-defvariant
  (:use :cl :defvariant))

(in-package :try-defvariant)

(defvariant btree
   (leaf)
   (node val left right))

=> MATCH-BTREE

(let ((my-tree
        (make-btree-node :val 42 
                         :left (make-btree-leaf) 
                         :right (make-btree-leaf))))
  (match-btree my-tree
        (leaf _ "leaf !")
        (node (v _ _) v)))

=> 42


See. defvariant.md for the whole story.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

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


Previous: , Up: Systems   [Contents][Index]

2.1 defvariant

Author

Frederic Peschanski (format nil <frederic~Apeschanski~Awork~Agmail~Acom>

License

BSD 2-Clause. See LICENSE.

Description

Variants in Common Lisp.

Version

1.1

Source

defvariant.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

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


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 defvariant.asd

Location

defvariant.asd

Systems

defvariant (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 defvariant/package.lisp

Parent

defvariant (system)

Location

package.lisp

Packages

defvariant


Previous: , Up: Lisp files   [Contents][Index]

3.1.3 defvariant/defvariant.lisp

Dependency

package.lisp (file)

Parent

defvariant (system)

Location

defvariant.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 defvariant

Source

package.lisp (file)

Nickname

variant

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

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


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Macros

Macro: defvariant VARIANT &body VARIANT-CASES
Package

defvariant

Source

defvariant.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Generic functions

Generic Function: match-error-message CONDITION
Package

defvariant

Methods
Method: match-error-message (CONDITION match-error)
Source

defvariant.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Conditions

Condition: match-error ()
Package

defvariant

Source

defvariant.lisp (file)

Direct superclasses

error (condition)

Direct methods

match-error-message (method)

Direct slots
Slot: message
Initargs

:message

Readers

match-error-message (generic function)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

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 (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

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 (file)

Macro: lets BINDERS EXPR &body BODY

An abbreviation for MULTIPLE-VALUE-BIND.

Package

defvariant

Source

defvariant.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.3 Functions

Function: build-case-slots CASE-ID VARIANT-CASES
Package

defvariant

Source

defvariant.lisp (file)

Function: build-case-struct VARIANT CASE-LBL OPTS CASE-VALS
Package

defvariant

Source

defvariant.lisp (file)

Function: build-condition VARIANT CASE-ID VAL
Package

defvariant

Source

defvariant.lisp (file)

Function: build-dispatch VARIANT VARIANT-CASES MATCH-CASES VAL
Package

defvariant

Source

defvariant.lisp (file)

Function: build-lambda-parameters PARAMS BODY
Package

defvariant

Source

defvariant.lisp (file)

Function: build-match-args VARIANT CASE CASE-SLOTS VAL
Package

defvariant

Source

defvariant.lisp (file)

Function: build-match-function CASE-SPEC
Package

defvariant

Source

defvariant.lisp (file)

Function: build-match-macro VARIANT VARIANT-CASES
Package

defvariant

Source

defvariant.lisp (file)

Function: build-structs VARIANT OPTS CASES
Package

defvariant

Source

defvariant.lisp (file)

Function: build-type-struct VARIANT OPTS
Package

defvariant

Source

defvariant.lisp (file)

Function: stringify &rest ARGS

Converts to a string and append all ‘ARGS‘.

Package

defvariant

Source

defvariant.lisp (file)

Function: symbolize &rest ARGS

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

Package

defvariant

Source

defvariant.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.4 Generic functions

Generic Function: match-warning-message CONDITION
Package

defvariant

Methods
Method: match-warning-message (CONDITION match-warning)
Source

defvariant.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.5 Conditions

Condition: match-warning ()
Package

defvariant

Source

defvariant.lisp (file)

Direct superclasses

warning (condition)

Direct methods

match-warning-message (method)

Direct slots
Slot: message
Initargs

:message

Readers

match-warning-message (generic function)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   D   F   L  
Index Entry  Section

D
defvariant.asd: The defvariant<dot>asd file
defvariant/defvariant.lisp: The defvariant/defvariant<dot>lisp file
defvariant/package.lisp: The defvariant/package<dot>lisp file

F
File, Lisp, defvariant.asd: The defvariant<dot>asd file
File, Lisp, defvariant/defvariant.lisp: The defvariant/defvariant<dot>lisp file
File, Lisp, defvariant/package.lisp: The defvariant/package<dot>lisp file

L
Lisp File, defvariant.asd: The defvariant<dot>asd file
Lisp File, defvariant/defvariant.lisp: The defvariant/defvariant<dot>lisp file
Lisp File, defvariant/package.lisp: The defvariant/package<dot>lisp file

Jump to:   D   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

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

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

D
defvariant: Exported macros

E
example: Internal macros

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

G
Generic Function, match-error-message: Exported generic functions
Generic Function, match-warning-message: Internal generic functions

L
lets: Internal macros

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

S
stringify: Internal functions
symbolize: Internal functions

Jump to:   B   D   E   F   G   L   M   S  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
M   S  
Index Entry  Section

*
*example-enabled*: Internal special variables

M
message: Exported conditions
message: Internal conditions

S
Slot, message: Exported conditions
Slot, message: Internal conditions
Special Variable, *example-enabled*: Internal special variables

Jump to:   *  
M   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   C   D   M   P   S  
Index Entry  Section

C
Condition, match-error: Exported conditions
Condition, match-warning: Internal conditions

D
defvariant: The defvariant system
defvariant: The defvariant package

M
match-error: Exported conditions
match-warning: Internal conditions

P
Package, defvariant: The defvariant package

S
System, defvariant: The defvariant system

Jump to:   C   D   M   P   S