This is the context-lite Reference Manual, version 0.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 05:50:40 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
context-lite
A CLOS extension to support specializing methods on special/dynamic variables.
Mark Polyakov
MIT
0.1.0
closer-mop
(system).
context-lite.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
context-lite/context-lite.lisp
context-lite
(system).
defgeneric*
(macro).
defmethod*
(macro).
ensure-generic*-function
(function).
initialize-instance
(method).
add-all-wrapper-methods
(method).
add-method*
(method).
combine-special-variable-precedence-ordered
(function).
combine-special-variable-precedence-unordered
(function).
ensure-generic*-function-using-class
(method).
generic*-function
(class).
generic*-gf
(reader method).
(setf generic*-gf)
(writer method).
generic*-inner-methods
(reader method).
(setf generic*-inner-methods)
(writer method).
generic*-inner-precedence-order
(method).
generic*-install-discriminating-function
(method).
generic*-name
(reader method).
(setf generic*-name)
(writer method).
generic*-normal-argument-precedence-order
(reader method).
(setf generic*-normal-argument-precedence-order)
(writer method).
generic*-normal-lambda-list
(reader method).
(setf generic*-normal-lambda-list)
(writer method).
generic*-special-variable-precedence-order
(reader method).
(setf generic*-special-variable-precedence-order)
(writer method).
generic*-wrapper-method-table
(reader method).
(setf generic*-wrapper-method-table)
(writer method).
lambda-list-required-arguments
(function).
method*
(class).
method*-special-variables
(reader method).
(setf method*-special-variables)
(writer method).
remove-all-wrapper-methods
(method).
remove-from-plist
(function).
wrap-method-function
(method).
wrapper-method-specializers
(method).
Packages are listed by definition order.
context-lite
clite
common-lisp
.
defgeneric*
(macro).
defmethod*
(macro).
ensure-generic*-function
(function).
add-all-wrapper-methods
(generic function).
add-method*
(generic function).
combine-special-variable-precedence-ordered
(function).
combine-special-variable-precedence-unordered
(function).
ensure-generic*-function-using-class
(generic function).
generic*-function
(class).
generic*-gf
(generic reader).
(setf generic*-gf)
(generic writer).
generic*-inner-methods
(generic reader).
(setf generic*-inner-methods)
(generic writer).
generic*-inner-precedence-order
(generic function).
generic*-install-discriminating-function
(generic function).
generic*-name
(generic reader).
(setf generic*-name)
(generic writer).
generic*-normal-argument-precedence-order
(generic reader).
(setf generic*-normal-argument-precedence-order)
(generic writer).
generic*-normal-lambda-list
(generic reader).
(setf generic*-normal-lambda-list)
(generic writer).
generic*-special-variable-precedence-order
(generic reader).
(setf generic*-special-variable-precedence-order)
(generic writer).
generic*-wrapper-method-table
(generic reader).
(setf generic*-wrapper-method-table)
(generic writer).
lambda-list-required-arguments
(function).
method*
(class).
method*-special-variables
(generic reader).
(setf method*-special-variables)
(generic writer).
remove-all-wrapper-methods
(generic function).
remove-from-plist
(function).
wrap-method-function
(generic function).
wrapper-method-specializers
(generic function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Create or modify a Context Lite generic*-function. Methods defined on a generic* function can
specialize on both explicit arguments and the value of special/dynamic variables at call time,
enabling context-based programming.
One method* may specialize on a different set of special variables than another method*. That
being said, the generic* function does internally store a list of all special variables that are
used in any method*, and the order of this list is important – it determines which method*s take
precedence over others when multiple method*s are applicable. This "special variable precedence
order" can be controlled by providing the :special-variable-precedence-order option to
defgeneric*. When this option is specified, the internal list of special variables will be
reordered so that the given special variables appear in the given order. You need not mention
every special variable used by method*s of the generic* function in
:special-variable-precedence-order, but beware that in this case defgeneric* may be forced to
change the relative precedence order between the provided special variables and other special
variables.
The normal lambda-list precedence is controlled in the same way as for standard generic functions.
When multiple method*s that specialize on both their normal arguments and on special variables are
applicable, the normal arguments always take precedence.
If not given explicitly, the special variable precedence order is determined like so: Whenever a
method* is added, any special variables given in the method*’s special variable lambda list which
were not used in any previous method* (or previously provided to
:special-variable-precedence-order) are added to the end of the special variable precedence order,
in the order given in the special variable lambda list.
See also: defmethod*
Define or redefine a Context Lite method*. A method* can specialize on both its explicit
arguments, and the value of special/dynamic variables at call time. The syntax is much the same as
for the standard defmethod, except that a (possibly empty) "special variable lambda list" must
be provided immediately after the normal lambda list. The special variable lambda list shall have
names of special variables in the place of argument names, and each argument can have class or eql
specializers, all with the usual syntax. A method is considered applicable when the explicit
arguments match the specializers in the normal lambda list, and when each special variable
mentioned in the special variable lambda list matches its specializer. No &optional, &key, etc
options are allowed in the special variable lambda list.
Much of the power of Context Lite stems from the fact that the method*s defined on a generic*
function may specialize on different sets of special variables. I.e., the special variable lambda
list for a method* may include special variables that are not mentioned in the special variable
lambda list of any other method* on the same generic* function.
Example:
(defvar *day-of-week* nil)
(defmethod* motd () ()
"It’s boring today.")
(defmethod* motd () ((*day-of-week* (eql ’monday))
"It’s Monday!!!")
(let ((*day-of-week* ’monday))
(motd) ; => "It’s Monday!!!"
)
See the documentation for defgeneric* to learn how precedence order works.
generic*-function
) &key name) ¶Given a full lambda list, with specializers, return a list of the required arguments.
Returns a propery-list with same keys and values as PLIST, except that keys in the list designated by KEYS and values corresponding to them are removed. The returned property-list may share structure with the PLIST, but PLIST is not destructively modified. Keys are compared using EQ.
generic*-function
)) ¶generic*-function
) (method method*
)) ¶generic*-function
) fn-name &rest options &key argument-precedence-order special-variable-precedence-order special-variables lambda-list generic-function-class method-class documentation &allow-other-keys) ¶generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
generic*-function
)) ¶generic*-function
)) ¶generic*-function
)) ¶automatically generated reader method
name
.
generic*-function
)) ¶automatically generated writer method
name
.
generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
generic*-function
)) ¶automatically generated reader method
generic*-function
)) ¶automatically generated writer method
method*
)) ¶method*
)) ¶The special lambda list, each element (*special-variable-name* . specializer),
where specializer is either a class metaobject or an eql-specializer (just like a normal method
specializer)
generic*-function
)) ¶generic*-function
) (method method*
) num-special-vars) ¶generic*-function
) (method method*
)) ¶Given a method* and a gf that already has at least all the special variables required by the method*, generate the full specializers list for the wrapper method.
funcallable-standard-object
.
add-all-wrapper-methods
.
add-method*
.
ensure-generic*-function-using-class
.
(setf generic*-gf)
.
generic*-gf
.
(setf generic*-inner-methods)
.
generic*-inner-methods
.
generic*-inner-precedence-order
.
generic*-install-discriminating-function
.
(setf generic*-name)
.
generic*-name
.
(setf generic*-normal-argument-precedence-order)
.
generic*-normal-argument-precedence-order
.
(setf generic*-normal-lambda-list)
.
generic*-normal-lambda-list
.
(setf generic*-special-variable-precedence-order)
.
generic*-special-variable-precedence-order
.
(setf generic*-wrapper-method-table)
.
generic*-wrapper-method-table
.
initialize-instance
.
remove-all-wrapper-methods
.
wrap-method-function
.
wrapper-method-specializers
.
(error "generic* functions need a :name")
:name
(make-hash-table)
standard-method
.
The special lambda list, each element (*special-variable-name* . specializer),
where specializer is either a class metaobject or an eql-specializer (just like a normal method
specializer)
:special-variables
Jump to: | (
A C D E F G I L M R W |
---|
Jump to: | (
A C D E F G I L M R W |
---|
Jump to: | I N S W |
---|
Jump to: | I N S W |
---|
Jump to: | C F G M P S |
---|
Jump to: | C F G M P S |
---|