This is the more-conditions Reference Manual, version 0.4.5, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 07:06:58 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
more-conditions
This system provides some generic condition classes in conjunction with support functions and macros.
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
Jan Moringen <jmoringe@techfak.uni-bielefeld.de>
LLGPLv3
The idea is similar to
‘alexandria:required-argument’ but more
fine-grained.
In addition, there is support for translating conditions at layer boundaries in larger systems.
0.4.5
alexandria
(system).
closer-mop
(system)., at least version "1.0.0"
src
(module).
readme.org
(file).
Modules are listed depth-first from the system components tree.
more-conditions/src
more-conditions
(system).
package.lisp
(file).
types.lisp
(file).
variables.lisp
(file).
protocol.lisp
(file).
conditions.lisp
(file).
macros.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
more-conditions/more-conditions.asd
more-conditions/src/package.lisp
more-conditions/src/types.lisp
more-conditions/src/variables.lisp
more-conditions/src/protocol.lisp
more-conditions/src/conditions.lisp
more-conditions/src/macros.lisp
more-conditions/more-conditions.asd
more-conditions
(system).
more-conditions/src/types.lisp
package.lisp
(file).
src
(module).
progress->real
(function).
progress-designator
(type).
reference-document
(function).
reference-link
(function).
reference-part
(function).
reference-spec
(type).
more-conditions/src/variables.lisp
types.lisp
(file).
src
(module).
*print-references*
(special variable).
more-conditions/src/protocol.lisp
variables.lisp
(file).
src
(module).
cause
(generic function).
condition-references
(generic function).
default-references
(generic function).
direct-default-references
(generic function).
progress-condition-message
(generic function).
root-cause
(generic function).
default-initarg-value
(function).
more-conditions/src/conditions.lisp
protocol.lisp
(file).
src
(module).
cause
(reader method).
chainable-condition
(condition).
condition-references
(method).
condition-references
(method).
incompatible-arguments
(function).
incompatible-arguments
(condition).
incompatible-arguments-parameters
(reader method).
incompatible-arguments-values
(reader method).
incompatible-initargs
(function).
incompatible-initargs
(condition).
initarg-error
(condition).
initarg-error-class
(reader method).
maybe-print-cause
(function).
maybe-print-explanation
(function).
missing-required-argument
(function).
missing-required-argument
(condition).
missing-required-argument-parameter
(reader method).
missing-required-initarg
(function).
missing-required-initarg
(condition).
print-object
(method).
print-object
(method).
print-object
(method).
print-reference
(function).
progress
(function).
progress-condition
(condition).
progress-condition-message
(method).
progress-condition-operation
(reader method).
progress-condition-progress
(reader method).
(setf progress-condition-progress)
(writer method).
progressing
(function).
reference-condition
(condition).
root-cause
(method).
shared-initialize
(method).
simple-progress-condition
(condition).
%progress
(function).
condition-%references
(reader method).
(setf condition-%references)
(writer method).
print-arguments
(function).
print-progress-percentage
(function).
more-conditions/src/macros.lisp
conditions.lisp
(file).
src
(module).
define-condition-translating-method
(macro).
error-behavior-restart-case
(macro).
with-condition-translation
(macro).
with-sequence-progress
(macro).
with-trivial-progress
(macro).
Packages are listed by definition order.
more-conditions
This package provides generic conditions and condition-related
utilities.
Conditions
* ‘chainable-condition’
* ‘missing-required-argument’
* ‘missing-required-initarg’
* ‘incompatible-arguments’
* ‘incompatible-initargs’
* ‘reference-condition’
* ‘progress-condition’
* ‘simple-progress-condition’
Condition helper functions
* ‘maybe-print-cause’
* ‘maybe-print-explanation’
* ‘print-reference’
Macros
* ‘with-condition-translation’
* ‘define-condition-translating-method’
* ‘error-behavior-restart-cases’
* ‘with-trivial-progress’
* ‘with-sequence-progress’
alexandria
.
common-lisp
.
*print-references*
(special variable).
cause
(generic function).
chainable-condition
(condition).
condition-references
(generic function).
default-references
(generic function).
define-condition-translating-method
(macro).
direct-default-references
(generic function).
error-behavior-restart-case
(macro).
incompatible-arguments
(function).
incompatible-arguments
(condition).
incompatible-arguments-parameters
(generic reader).
incompatible-arguments-values
(generic reader).
incompatible-initargs
(function).
incompatible-initargs
(condition).
initarg-error
(condition).
initarg-error-class
(generic reader).
maybe-print-cause
(function).
maybe-print-explanation
(function).
missing-required-argument
(function).
missing-required-argument
(condition).
missing-required-argument-parameter
(generic reader).
missing-required-initarg
(function).
missing-required-initarg
(condition).
print-reference
(function).
progress
(function).
progress->real
(function).
progress-condition
(condition).
progress-condition-message
(generic function).
progress-condition-operation
(generic reader).
progress-condition-progress
(generic reader).
(setf progress-condition-progress)
(generic writer).
progress-designator
(type).
progressing
(function).
reference-condition
(condition).
reference-document
(function).
reference-link
(function).
reference-part
(function).
reference-spec
(type).
root-cause
(generic function).
simple-progress-condition
(condition).
with-condition-translation
(macro).
with-sequence-progress
(macro).
with-trivial-progress
(macro).
%progress
(function).
condition-%references
(generic reader).
(setf condition-%references)
(generic writer).
default-initarg-value
(function).
print-arguments
(function).
print-progress-percentage
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
When non-nil, ‘reference-condition’ instances print reference information in addition to the primary condition report.
Define a method on the generic function designated by NAME which translates conditions according to CLAUSES (For a description of CLAUSES, see ‘with-condition-translation’).
Select error/warning signaling of ERROR-CONDITION or
WARNING-CONDITION according to VAR and establish restarts as
specified in CLAUSES.
CLAUSES use the same syntax as the restart clauses in
‘cl:restart-case’.
INITARGS are passed to the constructed conditions.
ALLOW-OTHER-VALUES? controls whether the form should evaluate to
the value of VAR if it is not a function.
Example:
(flet ((try-policy (policy)
(error-behavior-restart-case
(policy
(simple-error
:format-control "Example error: ~A"
:format-arguments (list :foo))
:warning-condition simple-warning
:allow-other-values? t)
(continue (&optional condition)
:continue))))
;; (try-policy #’error) => Error: Example error: FOO
;; (try-policy ’error) => Error: Example error: FOO
(mapcar #’try-policy (list warn #’warn continue #’continue 1 :foo nil)))
| WARNING: Example error: FOO
| WARNING: Example error: FOO
=> (nil nil :continue :continue 1 :foo nil)
Execute BODY translating conditions as specified by CLAUSES when
they are signaled.
CLAUSES is a list of clauses of the form
((FROM-CONDITION TO-CONDITION
&key
var
cause-initarg
signal-via
muffle?)
INITARG1 VALUE1
INITARG2 VALUE2
...)
FROM-CONDITION specifies a condition type (as e.g. in
‘cl:handler-bind’) instances of which should be translated to
instances of the condition class designated by TO-CONDITION.
The instance of TO-CONDITIONS is signaled via the value
of :SIGNAL-VIA (default is ‘cl:error’) and receives the initargs
INITARG1 VALUE1, INITARG2 VALUE2, ... and the value
of :CAUSE-INITARG (default is :CAUSE) with the original condition
instance as its value. When the value of :CAUSE-INITARG is nil, the
original condition is not passed to the constructed condition
instance.
If supplied, the value of :VAR names a variable in which the
original condition instance should be received.
MUFFLE? controls whether the original condition should be muffled
after the translation has been performed. (This is useful for
‘cl:warning’s and generic ‘cl:condition’s which would not get
handled by resignaling via e.g. ‘cl:warn’).
CHAIN-SAME-CLASS? controls whether conditions which already are instances of TO-CONDITION should still be wrapped in a TO-CONDITION instance. The default is false.
Signal progress conditions for OPERATION on SEQUENCE during the
execution of BODY.
The function ‘progress’ is shadowed in the lexical scope of BODY
with the following syntax:
progress [ format-control-or-condition-class
format-arguments-or-initargs* ]
Calling this function indicates that the processing of SEQUENCE advanced by one element. As with ‘cl:signal’, ‘cl:error’ and ‘cl:warn’, FORMAT-CONTROL-OR-CONDITION-CLASS and FORMAT-ARGUMENTS-OR-INITARGS either specify a condition class and initargs or a report format control string and format arguments.
After the completion of or non-local exit from BODY, a condition indicating the completion of OPERATION is signaled automatically.
Signal one progress condition for OPERATION for the start and end
of the execution of BODY respectively.
As with ‘cl:signal’, ‘cl:error’ and ‘cl:warn’, FORMAT-CONTROL-OR-CONDITION-CLASS and FORMAT-ARGUMENTS-OR-INITARGS either specify a condition class and initargs or a report format control string and format arguments.
Signal an ‘incompatible-arguments’ error for ARGUMENTS which has to
be of the form
PARAMETER1 VALUE1 PARAMETER2 VALUE2 ...
Signal an ‘incompatible-initargs’ error for CLASS and INITARGS.
Print the condition that caused CONDITION to be signaled (if any) onto STREAM.
Format the message contained in the ‘simple-condition’ CONDITION on
STREAM.
If CONDITION does not have a message, print ".". This is intended
for messages which can be either
"MESSAGE."
or "MESSAGE: EXPLANATION".
When COLON? is non-nil, the explanation is printed in an indented
logical block.
When AT? is non-nil and CONDITION does not have an explanation, suppress printing ".".
Signal a ‘missing-required-argument’ error for PARAMETER.
Signal a ‘missing-required-initarg’ error for CLASS and INITARG.
Print reference SPEC onto STREAM. AT? and COLON? are ignored.
Signal a progress condition indicating completion status PROGRESS
for OPERATION.
As with ‘cl:signal’, ‘cl:error’ and ‘cl:warn’, FORMAT-CONTROL-OR-CONDITION-CLASS and FORMAT-ARGUMENTS-OR-INITARGS either specify a condition class and initargs or a report format control string or function with format arguments.
Return a function which signals a progress condition for OPERATION
and calls FUNCTION.
As with ‘cl:signal’, ‘cl:error’ and ‘cl:warn’,
FORMAT-CONTROL-OR-CONDITION-CLASS and FORMAT-ARGUMENTS-OR-INITARGS
either specify a condition class and initargs or a report format
control string or function with format arguments. However, if
FORMAT-CONTROL-OR-CONDITION-CLASS is nil, a format string which
prints all arguments passed to FUNCTION is used.
Example:
(let ((items ’(1 2 3 4 5)))
(with-sequence-progress (:foo items)
(mapcar (progressing #’1+ :foo "Frobbing") items)))
Return the document of SPEC.
Return the link of SPEC.
Return the part of SPEC.
Return the condition that was signaled and caused CONDITION to be signaled.
chainable-condition
)) ¶condition
)) ¶Return a list of references (of type ‘reference-spec’) which are associated to CONDITION.
reference-condition
)) ¶chainable-condition
)) ¶Return a list of references (of type ‘reference-spec’) which are the default references for CLASS (and all of CLASSes superclasses; i.e. transitive ‘direct-default-references’-closure).
Return a list of references (of type ‘reference-spec’) which are the default references for CLASS (but not CLASSes superclasses; see ‘default-references’).
incompatible-arguments
)) ¶incompatible-arguments
)) ¶initarg-error
)) ¶missing-required-argument
)) ¶Return a string describing CONDITION or nil.
simple-progress-condition
)) ¶condition
)) ¶progress-condition
)) ¶progress-condition
)) ¶progress-condition
)) ¶Return the condition that was originally signaled and eventually caused CONDITION to be signaled.
chainable-condition
)) ¶condition
)) ¶reference-condition
) stream) ¶progress-condition
) stream) ¶simple-progress-condition
) stream) ¶Instances of this class can contain another condition instance which originally caused the condition to be signaled. This structure can continue recursively thus forming a chain of causing conditions.
condition
.
This error is signaled when an incompatible combination of arguments is supplied.
chainable-condition
.
program-error
.
Initarg | Value |
---|---|
:values | (missing-required-initarg (quote incompatible-arguments) values) |
:parameters | (missing-required-initarg (quote incompatible-arguments) parameters) |
A list of the parameters for which incompatible values have been supplied.
:parameters
This slot is read-only.
A list of the incompatible values.
common-lisp
.
:values
This slot is read-only.
This error is signaled when incompatible initargs are supplied.
This error is signaled when invalid initargs are supplied.
program-error
.
Initarg | Value |
---|---|
:class | (missing-required-initarg (quote initarg-error) class) |
The class for which the initarg error occurred.
common-lisp
.
:class
This slot is read-only.
This error is signaled when no value is supplied for a required parameter.
program-error
.
Initarg | Value |
---|---|
:parameter | (missing-required-initarg (quote missing-required-argument) parameter) |
The parameter for which a value should have been supplied.
:parameter
This slot is read-only.
This error is signaled when an initarg that is required by a class is not supplied.
This condition is signaled to indicate the progress of execution
of an operation during the execution of that operation
Note that this condition does not have to be handled and its signaling usually does not lead to a transfer of control.
condition
.
Stores a symbol identifying the operation for which the condition reports progress.
(quote nil)
:operation
This slot is read-only.
Stores the operation progress indicated by the condition. See type ‘progress-designator’.
(quote nil)
:progress
This condition class is intended to be mixed into condition classes which can associate documentation references to their instances.
condition
.
Stores a list of references of type ‘reference-spec’.
(quote :compute)
:references
Like ‘progress-condition’ but supports format control and format arguments to produce a report to go along with the raw progress information.
progress-condition
.
simple-condition
.
Values describe progress of an operation.
nil
Progress is not known
t
Task has been completed.
real
Completion percentage as a real number between 0 (no progress) and 1 (completed; note that t should be used in this case, at least in a subsequently signaled condition).
A documentation reference of the form
(DOCUMENT PART [LINK])
where DOCUMENT is a keyword, PART is a string or list of strings and LINK, if present, is a string.
Print PARAMETERS-AND-VALUES which has to be of the form
(PARAMETERS VALUES)
onto STREAM. AT? and COLON? are ignored.
reference-condition
)) ¶reference-condition
)) ¶Jump to: | %
(
C D E F G I M P R S W |
---|
Jump to: | %
(
C D E F G I M P R S W |
---|
Jump to: | *
C O P R S V |
---|
Jump to: | *
C O P R S V |
---|
Jump to: | C F I M P R S T V |
---|
Jump to: | C F I M P R S T V |
---|