The moptilities Reference Manual

Table of Contents

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

The moptilities Reference Manual

This is the moptilities Reference Manual, version 0.3.13, generated automatically by Declt version 2.3 "Robert April" on Wed Mar 14 04:20:29 2018 GMT+0.


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

1 Systems

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


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

1.1 moptilities

Maintainer

Gary Warren King <gwking@metabang.com>

Author

Gary Warren King <gwking@metabang.com>

License

MIT Style license

Description

Common Lisp MOP utilities

Long Description

MOP utilities provide a common interface between lisps and make the MOP easier to use.

Version

0.3.13

Dependencies
Source

moptilities.asd (file)

Components

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

2 Modules

Modules are listed depth-first from the system components tree.


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

2.1 moptilities/dev

Parent

moptilities (system)

Location

dev/

Components

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

2.2 moptilities/website

Parent

moptilities (system)

Location

website/

Component

source (module)


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

2.3 moptilities/website/source

Parent

website (module)

Location

website/source/

Component

index.md (file)


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

3 Files

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


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

3.1 Lisp


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

3.1.1 moptilities.asd

Location

moptilities.asd

Systems

moptilities (system)


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

3.1.2 moptilities/dev/moptilities.lisp

Parent

dev (module)

Location

dev/moptilities.lisp

Packages

metabang.moptilities

Exported Definitions
Internal Definitions

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

3.2 Other


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

3.2.1 moptilities/dev/notes.text

Parent

dev (module)

Location

dev/notes.text


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

3.2.2 moptilities/website/source/index.md

Parent

source (module)

Location

website/source/index.md


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

4 Packages

Packages are listed by definition order.


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

4.1 metabang.moptilities

Moptilities builds on the Lisp Meta-Object Protocol (**MOP**).

Source

moptilities.lisp (file)

Nicknames
Use List

closer-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 Special variables

Special Variable: *debugging-finalization*

When true, finalization messages are printed to *debug-io*

Package

metabang.moptilities

Source

moptilities.lisp (file)


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

5.1.2 Functions

Function: care-when-finalized OBJECT

Ensures the when-finalized is called on the object just before it is garbage collected.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: default-initargs CLASS-SPECIFIER

Returns a list of default initarg information for the class-specifier. This list consists of triples in the format <initarg value function>. The initarg is the initarg corresponding to the default-initarg; the value is the value it will default to and the function is a function of zero-arguments that returns value... (this is subject to minor changes).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: direct-specializers-of THING &key WRITERS? READERS? OTHER? SHORT-FORM?

Returns a list of the direct specializers of thing. Thing can a class, object representing a class or symbol naming a class. The keyword arguments :readers?, :writers?, and :other? control which specializers are returned (reader methods, writer methods and other methods respectively). The keyword argument :short-form? controls whether a list of methods is returned or just a list of names.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: direct-subclasses THING

Returns the immediate subclasses of thing. Thing can be a class, object or symbol naming a class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: direct-superclasses THING

Returns the immediate superclasses of thing. Thing can be a class, object or symbol naming a class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: finalize-class-if-necessary THING

Finalizes thing if necessary. Thing can be a class, object or symbol naming a class. Returns the class of thing.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: function-arglist SYMBOL

Returns two values, the arglist of symbol

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: generic-functions THING

Returns a list of all of the direct generic-functions associated with thing. Thing can be a class, object, or symbol naming a class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: ignore-finalization OBJECT

Prevents care-when-finalized from being called on object just before it is garbage collected.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: leaf-class-p THING

Returns true if the class has no subclasses.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: leaf-subclasses THING

Returns a list of subclasses of thing that have no subclasses of their own; i.e., the leaves of the class tree rooted at thing. Thing can be a class, object or symbol naming a class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: map-methods THING FN

Applys fn to all of the direct methods of thing (which can be a class, object or symbol naming a class). The function should take two arguments: a generic function and a method.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: map-subclasses CLASS FN &key PROPER?

Applies fn to each subclass of class. If proper? is true, then
the class itself is not included in the mapping. Proper? defaults to nil.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: mopu-class-initargs THING
Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: remove-generic-function FUNCTION-DESIGNATOR
Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: remove-methods CLASS-SPECIFIER &rest ARGS &key DRY-RUN? VERBOSE? IGNORE-ERRORS?

Removes all methods associated with class-specifier. Class-specifier can be a class, object representing a class or symbol naming a class. If dry-run? is true (and verbose? is also true), then the methods that would be removed are printed but no methods are actually removed. Returns the number of methods that are removed (or that would have been removed if dry-run? is true).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: remove-methods-if CLASS-SPECIFIER PREDICATE &key DRY-RUN? VERBOSE? IGNORE-ERRORS?

Removes all methods associated with class-specifier that pass a predicate. Class-specifier can be a class, object representing a class or symbol naming a class. The predicate should be a function of two arguments: a generic-function and a method. If dry-run? is true (and verbose? is also true), then the methods that would be removed are printed but no methods are actually removed. Returns the number of methods that are removed (or that would have been removed if dry-run? is true).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: specializers-of CLASS &rest ARGS &key SHORT-FORM? WRITERS? READERS? OTHER? IGNORE-CLASSES

Like direct-specializers-of but returns all the specializers, not just the direct ones.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: subclasses CLASS &key PROPER?

Returns the subclasses of ‘class‘.

Class may be a symbol naming a class, a instance of a class or a class object. If ‘proper?‘ is true (the default) then the class itself will _not_ be included in the result. If ‘proper?‘ is nil, then it will.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: superclasses THING &key PROPER?

Returns a list of superclasses of thing. Thing can be a class, object or symbol naming a class. The list of classes returned is ’proper’; it does not include the class itself.

Package

metabang.moptilities

Source

moptilities.lisp (file)


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

5.1.3 Generic functions

Generic Function: class-name-of THING

Returns the name of thing’s class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: class-name-of (THING standard-object)
Method: class-name-of (THING class)
Generic Function: copy-template OBJECT

Suppose you make an instance of the class foo:

(defclass foo ()
((test :accessor test :initform #’equal :initarg :test)))

(setf *foo* (make-instance ’foo :test #’eql))

Its ‘test‘ slot will be set to #’eql:

(test *foo*) => #’eql

If you want to make a structural clone (for lack of a better term) of ‘*foo*‘, you might try:

(setf *new-foo* (make-instance (type-of *foo*)))

But ‘*new-foo*‘’s test slot won’t be set properly:

(test *new-foo*) => #’equal

For simple classes, this is no problem but suppose we have
a graph from [CL-Graph][] and want to make a copy of that:

(make-graph (type-of old-graph)
:vertex-test (vertex-test old-graph)
:vertex-key (vertex-key old-graph)
:edge-test (edge-test old-graph)
:edge-key (edge-key old-graph)
:default-edge-type (default-edge-type old-graph) :default-edge-class (default-edge-class old-graph) :directed-edge-class (directed-edge-class old-graph) :undirected-edge-class (undirected-edge-class old-graph))))

Yuck!

Copy-template is a reasonable, though not perfect, solution to this problem; it creates a structural copy of an object such that the copy has all of its initargs correctly set.

[CL-Graph]: http://common-lisp.net/projects/cl-graph/

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: copy-template (OBJECT standard-object)
Generic Function: direct-slot-names CLASS-SPECIFIER

Returns a list of the names of the slots that are defined _directly_ in the class-specifier (as opposed to slots defined in superclasses).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: direct-slot-names (CLASS symbol)
Method: direct-slot-names (CLASS standard-object)
Method: direct-slot-names (CLASS class)
Generic Function: eql-specializer-p THING

If thing is an eql-specializer, returns a representation of thing as (eql <object>).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: eql-specializer-p (THING eql-specializer)
Method: eql-specializer-p THING
Generic Function: get-class THING &key ERROR?

Returns the class of thing or nil if the class cannot be found. Thing can be a class, an object representing a class or a symbol naming a class. Get-class is like find-class only not as particular.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: get-class (THING symbol) &key ERROR?
Method: get-class (THING standard-object) &key ERROR?
Method: get-class THING &key ERROR?
Method: get-class (THING class) &key ERROR?
Generic Function: get-method FUNCTION QUALIFIERS &rest SPECIALIZERS
Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: get-method (FUNCTION symbol) QUALIFIERS &rest SPECIALIZERS
Method: get-method (FUNCTION standard-generic-function) QUALIFIERS &rest SPECIALIZERS
Generic Function: get-slot-definition CLASS SLOT-NAME

Returns the slot-definition for the slot named ‘slot-name‘ in the class specified by ‘class-specifier‘. Also returns (as a second value) true if the slot is an indirect slot of the class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: get-slot-definition CLASS-SPECIFIER SLOT-NAME
Generic Function: method-name METHOD
Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: method-name (METHOD standard-method)
Generic Function: reader-method-p THING

Returns true if thing is a reader method (i.e., a subclass of standard-reader-method).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: reader-method-p (M standard-reader-method)
Method: reader-method-p M
Generic Function: slot-names CLASS

Returns a list of the names of the slots of a class ~ (including both direct and inherited slots). It’s like ~ class-slot-names but on the class, not an instance of the class.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: slot-names (CLASS class)
Method: slot-names (CLASS symbol)
Method: slot-names (CLASS standard-object)
Method: slot-names (CLASS structure-object)
Generic Function: slot-properties CLASS-SPECIFIER SLOT-NAME

Returns a property list describing the slot named slot-name in class-specifier.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: slot-properties (CLASS symbol) SLOT-NAME
Method: slot-properties (OBJECT standard-object) SLOT-NAME
Method: slot-properties (CLASS class) SLOT-NAME
Generic Function: when-finalized THING

Called just before an object is garbage collected if care-when-finalize has been called on the object.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: when-finalized OBJECT around
Method: when-finalized OBJECT
Generic Function: writer-method-p THING

Returns true if thing is a writer method (i.e., a subclass of standard-writer-method).

Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: writer-method-p (M standard-writer-method)
Method: writer-method-p M

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

5.2 Internal definitions


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

5.2.1 Macros

Macro: nyi FUNCTION-NAME &rest ARGS

Signals an error saying that ‘function-name‘ is not yet implemented. The ‘args‘ are ignored.

Package

metabang.moptilities

Source

moptilities.lisp (file)


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

5.2.2 Functions

Function: get-structure NAME &optional ERRORP

get-structure name

If ‘name’ has been defined as a structure then return its description. Otherwise signal an error if errorp is t.

Package

metabang.moptilities

Source

moptilities.lisp (file)

Function: in-order-p C1 C2
Package

metabang.moptilities

Source

moptilities.lisp (file)


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

5.2.3 Generic functions

Generic Function: get-function FUNCTION-DESIGNATOR
Package

metabang.moptilities

Source

moptilities.lisp (file)

Methods
Method: get-function (FUNCTION symbol)
Method: get-function (FUNCTION standard-generic-function)

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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   M   O  
Index Entry  Section

F
File, Lisp, moptilities.asd: The moptilities<dot>asd file
File, Lisp, moptilities/dev/moptilities.lisp: The moptilities/dev/moptilities<dot>lisp file
File, other, moptilities/dev/notes.text: The moptilities/dev/notes<dot>text file
File, other, moptilities/website/source/index.md: The moptilities/website/source/index<dot>md file

L
Lisp File, moptilities.asd: The moptilities<dot>asd file
Lisp File, moptilities/dev/moptilities.lisp: The moptilities/dev/moptilities<dot>lisp file

M
Module, moptilities/dev: The moptilities/dev module
Module, moptilities/website: The moptilities/website module
Module, moptilities/website/source: The moptilities/website/source module
moptilities.asd: The moptilities<dot>asd file
moptilities/dev: The moptilities/dev module
moptilities/dev/moptilities.lisp: The moptilities/dev/moptilities<dot>lisp file
moptilities/dev/notes.text: The moptilities/dev/notes<dot>text file
moptilities/website: The moptilities/website module
moptilities/website/source: The moptilities/website/source module
moptilities/website/source/index.md: The moptilities/website/source/index<dot>md file

O
Other File, moptilities/dev/notes.text: The moptilities/dev/notes<dot>text file
Other File, moptilities/website/source/index.md: The moptilities/website/source/index<dot>md file

Jump to:   F   L   M   O  

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

A.2 Functions

Jump to:   C   D   E   F   G   I   L   M   N   R   S   W  
Index Entry  Section

C
care-when-finalized: Exported functions
class-name-of: Exported generic functions
class-name-of: Exported generic functions
class-name-of: Exported generic functions
copy-template: Exported generic functions
copy-template: Exported generic functions

D
default-initargs: Exported functions
direct-slot-names: Exported generic functions
direct-slot-names: Exported generic functions
direct-slot-names: Exported generic functions
direct-slot-names: Exported generic functions
direct-specializers-of: Exported functions
direct-subclasses: Exported functions
direct-superclasses: Exported functions

E
eql-specializer-p: Exported generic functions
eql-specializer-p: Exported generic functions
eql-specializer-p: Exported generic functions

F
finalize-class-if-necessary: Exported functions
Function, care-when-finalized: Exported functions
Function, default-initargs: Exported functions
Function, direct-specializers-of: Exported functions
Function, direct-subclasses: Exported functions
Function, direct-superclasses: Exported functions
Function, finalize-class-if-necessary: Exported functions
Function, function-arglist: Exported functions
Function, generic-functions: Exported functions
Function, get-structure: Internal functions
Function, ignore-finalization: Exported functions
Function, in-order-p: Internal functions
Function, leaf-class-p: Exported functions
Function, leaf-subclasses: Exported functions
Function, map-methods: Exported functions
Function, map-subclasses: Exported functions
Function, mopu-class-initargs: Exported functions
Function, remove-generic-function: Exported functions
Function, remove-methods: Exported functions
Function, remove-methods-if: Exported functions
Function, specializers-of: Exported functions
Function, subclasses: Exported functions
Function, superclasses: Exported functions
function-arglist: Exported functions

G
Generic Function, class-name-of: Exported generic functions
Generic Function, copy-template: Exported generic functions
Generic Function, direct-slot-names: Exported generic functions
Generic Function, eql-specializer-p: Exported generic functions
Generic Function, get-class: Exported generic functions
Generic Function, get-function: Internal generic functions
Generic Function, get-method: Exported generic functions
Generic Function, get-slot-definition: Exported generic functions
Generic Function, method-name: Exported generic functions
Generic Function, reader-method-p: Exported generic functions
Generic Function, slot-names: Exported generic functions
Generic Function, slot-properties: Exported generic functions
Generic Function, when-finalized: Exported generic functions
Generic Function, writer-method-p: Exported generic functions
generic-functions: Exported functions
get-class: Exported generic functions
get-class: Exported generic functions
get-class: Exported generic functions
get-class: Exported generic functions
get-class: Exported generic functions
get-function: Internal generic functions
get-function: Internal generic functions
get-function: Internal generic functions
get-method: Exported generic functions
get-method: Exported generic functions
get-method: Exported generic functions
get-slot-definition: Exported generic functions
get-slot-definition: Exported generic functions
get-structure: Internal functions

I
ignore-finalization: Exported functions
in-order-p: Internal functions

L
leaf-class-p: Exported functions
leaf-subclasses: Exported functions

M
Macro, nyi: Internal macros
map-methods: Exported functions
map-subclasses: Exported functions
Method, class-name-of: Exported generic functions
Method, class-name-of: Exported generic functions
Method, copy-template: Exported generic functions
Method, direct-slot-names: Exported generic functions
Method, direct-slot-names: Exported generic functions
Method, direct-slot-names: Exported generic functions
Method, eql-specializer-p: Exported generic functions
Method, eql-specializer-p: Exported generic functions
Method, get-class: Exported generic functions
Method, get-class: Exported generic functions
Method, get-class: Exported generic functions
Method, get-class: Exported generic functions
Method, get-function: Internal generic functions
Method, get-function: Internal generic functions
Method, get-method: Exported generic functions
Method, get-method: Exported generic functions
Method, get-slot-definition: Exported generic functions
Method, method-name: Exported generic functions
Method, reader-method-p: Exported generic functions
Method, reader-method-p: Exported generic functions
Method, slot-names: Exported generic functions
Method, slot-names: Exported generic functions
Method, slot-names: Exported generic functions
Method, slot-names: Exported generic functions
Method, slot-properties: Exported generic functions
Method, slot-properties: Exported generic functions
Method, slot-properties: Exported generic functions
Method, when-finalized: Exported generic functions
Method, when-finalized: Exported generic functions
Method, writer-method-p: Exported generic functions
Method, writer-method-p: Exported generic functions
method-name: Exported generic functions
method-name: Exported generic functions
mopu-class-initargs: Exported functions

N
nyi: Internal macros

R
reader-method-p: Exported generic functions
reader-method-p: Exported generic functions
reader-method-p: Exported generic functions
remove-generic-function: Exported functions
remove-methods: Exported functions
remove-methods-if: Exported functions

S
slot-names: Exported generic functions
slot-names: Exported generic functions
slot-names: Exported generic functions
slot-names: Exported generic functions
slot-names: Exported generic functions
slot-properties: Exported generic functions
slot-properties: Exported generic functions
slot-properties: Exported generic functions
slot-properties: Exported generic functions
specializers-of: Exported functions
subclasses: Exported functions
superclasses: Exported functions

W
when-finalized: Exported generic functions
when-finalized: Exported generic functions
when-finalized: Exported generic functions
writer-method-p: Exported generic functions
writer-method-p: Exported generic functions
writer-method-p: Exported generic functions

Jump to:   C   D   E   F   G   I   L   M   N   R   S   W  

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

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*debugging-finalization*: Exported special variables

S
Special Variable, *debugging-finalization*: Exported special variables

Jump to:   *  
S  

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

A.4 Data types

Jump to:   M   P   S  
Index Entry  Section

M
metabang.moptilities: The metabang<dot>moptilities package
moptilities: The moptilities system

P
Package, metabang.moptilities: The metabang<dot>moptilities package

S
System, moptilities: The moptilities system

Jump to:   M   P   S