This is the doplus Reference Manual, version 1.1.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Dec 15 06:00:21 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
doplus
DO+ (doplus) is a high-level, extensible iteration construct for Common Lisp with a reasonably simple implementation, which in particular does not use a code walker.
Alessio Stalla <alessiostalla@gmail.com>
GPLv3
1.1.0
parse-declarations-1.0
(system).
packages.lisp
(file).
destructuring.lisp
(file).
doplus.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
doplus/destructuring.lisp
packages.lisp
(file).
doplus
(system).
extract-variables
(function).
make-destructuring-form
(function).
doplus/doplus.lisp
destructuring.lisp
(file).
doplus
(system).
*iteration-variable*
(special variable).
accumulating-to
(macro).
accumulating-to-and-returning
(macro).
across
(macro).
being
(macro).
collect
(macro).
collecting-into
(macro).
collecting-into-and-returning
(macro).
counting
(macro).
defclause
(macro).
do+
(macro).
finally
(macro).
finding
(macro).
for
(macro).
from
(macro).
generating
(macro).
hash-entries-of
(macro).
in
(macro).
in-list
(macro).
in-vector
(macro).
initially
(macro).
list-tails
(macro).
make-binding
(function).
make-epilogue
(function).
make-finalization
(function).
make-initialization
(function).
make-iteration
(function).
make-prologue
(function).
make-result
(function).
make-simple-iteration
(function).
make-step
(function).
make-termination
(function).
maximizing
(macro).
minimizing
(macro).
optimizing
(macro).
options
(macro).
options
(structure).
previous
(macro).
returning
(macro).
skip
(macro).
stop-when
(macro).
sum
(macro).
summing-to
(macro).
summing-to-and-returning
(macro).
symbols-in
(macro).
terminate
(macro).
to
(macro).
try-update
(macro).
update
(macro).
with
(macro).
%make-binding
(function).
*clauses*
(special variable).
accumulator
(structure).
accumulator-function
(reader).
(setf accumulator-function)
(writer).
accumulator-p
(function).
accumulator-var
(reader).
(setf accumulator-var)
(writer).
binding
(structure).
binding-default
(reader).
(setf binding-default)
(writer).
binding-default-provided?
(reader).
(setf binding-default-provided?)
(writer).
binding-p
(function).
binding-var
(reader).
(setf binding-var)
(writer).
copy-accumulator
(function).
copy-binding
(function).
copy-declaration
(function).
copy-doplus-env
(function).
copy-epilogue
(function).
copy-finalization
(function).
copy-generator
(function).
copy-initialization
(function).
copy-options
(function).
copy-prologue
(function).
copy-result
(function).
copy-step
(function).
copy-termination
(function).
copy-wrapper
(function).
declaration
(structure).
declaration-form
(reader).
(setf declaration-form)
(writer).
declaration-p
(function).
declaring
(macro).
do+/internal
(macro).
doplus-env
(structure).
doplus-env-accumulators
(reader).
(setf doplus-env-accumulators)
(writer).
doplus-env-default-collect-var
(reader).
(setf doplus-env-default-collect-var)
(writer).
doplus-env-generators
(reader).
(setf doplus-env-generators)
(writer).
doplus-env-loop-name
(reader).
(setf doplus-env-loop-name)
(writer).
doplus-env-p
(function).
doplus-env-parent
(reader).
(setf doplus-env-parent)
(writer).
doplus-env-skip-label
(reader).
(setf doplus-env-skip-label)
(writer).
doplus-env-terminate-label
(reader).
(setf doplus-env-terminate-label)
(writer).
ensure-list
(function).
epilogue
(structure).
epilogue-form
(reader).
(setf epilogue-form)
(writer).
epilogue-p
(function).
expand-with-simple-destructuring
(function).
finalization
(structure).
finalization-form
(reader).
(setf finalization-form)
(writer).
finalization-p
(function).
find-generator
(function).
find-loop-in-env
(function).
generator
(structure).
generator-clauses
(reader).
(setf generator-clauses)
(writer).
generator-name
(reader).
(setf generator-name)
(writer).
generator-p
(function).
initialization
(structure).
initialization-form
(reader).
(setf initialization-form)
(writer).
initialization-p
(function).
make-accumulator
(function).
make-declaration
(function).
make-doplus-env
(function).
make-generator
(function).
make-options
(function).
make-wrapper
(function).
options-map
(reader).
(setf options-map)
(writer).
options-p
(function).
prologue
(structure).
prologue-form
(reader).
(setf prologue-form)
(writer).
prologue-p
(function).
result
(structure).
result-form
(reader).
(setf result-form)
(writer).
result-p
(function).
step
(structure).
step-form
(reader).
(setf step-form)
(writer).
step-p
(function).
termination
(structure).
termination-condition
(reader).
(setf termination-condition)
(writer).
termination-p
(function).
until
(macro).
while
(macro).
with-atomic-updates
(macro).
with-atomic-updates*
(macro).
with-doplus-body
(macro).
without-atomic-updates
(macro).
wrapper
(structure).
wrapper-function
(reader).
(setf wrapper-function)
(writer).
wrapper-p
(function).
Packages are listed by definition order.
doplus
common-lisp
.
*iteration-variable*
(special variable).
accumulating-to
(macro).
accumulating-to-and-returning
(macro).
across
(macro).
being
(macro).
collect
(macro).
collecting-into
(macro).
collecting-into-and-returning
(macro).
counting
(macro).
defclause
(macro).
do+
(macro).
finally
(macro).
finding
(macro).
for
(macro).
from
(macro).
generating
(macro).
hash-entries-of
(macro).
in
(macro).
in-list
(macro).
in-vector
(macro).
initially
(macro).
list-tails
(macro).
make-binding
(function).
make-epilogue
(function).
make-finalization
(function).
make-initialization
(function).
make-iteration
(function).
make-prologue
(function).
make-result
(function).
make-simple-iteration
(function).
make-step
(function).
make-termination
(function).
maximizing
(macro).
minimizing
(macro).
optimizing
(macro).
options
(macro).
options
(structure).
previous
(macro).
returning
(macro).
skip
(macro).
stop-when
(macro).
sum
(macro).
summing-to
(macro).
summing-to-and-returning
(macro).
symbols-in
(macro).
terminate
(macro).
to
(macro).
try-update
(macro).
update
(macro).
with
(macro).
%make-binding
(function).
*clauses*
(special variable).
accumulator
(structure).
accumulator-function
(reader).
(setf accumulator-function)
(writer).
accumulator-p
(function).
accumulator-var
(reader).
(setf accumulator-var)
(writer).
binding
(structure).
binding-default
(reader).
(setf binding-default)
(writer).
binding-default-provided?
(reader).
(setf binding-default-provided?)
(writer).
binding-p
(function).
binding-var
(reader).
(setf binding-var)
(writer).
copy-accumulator
(function).
copy-binding
(function).
copy-declaration
(function).
copy-doplus-env
(function).
copy-epilogue
(function).
copy-finalization
(function).
copy-generator
(function).
copy-initialization
(function).
copy-options
(function).
copy-prologue
(function).
copy-result
(function).
copy-step
(function).
copy-termination
(function).
copy-wrapper
(function).
declaration
(structure).
declaration-form
(reader).
(setf declaration-form)
(writer).
declaration-p
(function).
declaring
(macro).
do+/internal
(macro).
doplus-env
(structure).
doplus-env-accumulators
(reader).
(setf doplus-env-accumulators)
(writer).
doplus-env-default-collect-var
(reader).
(setf doplus-env-default-collect-var)
(writer).
doplus-env-generators
(reader).
(setf doplus-env-generators)
(writer).
doplus-env-loop-name
(reader).
(setf doplus-env-loop-name)
(writer).
doplus-env-p
(function).
doplus-env-parent
(reader).
(setf doplus-env-parent)
(writer).
doplus-env-skip-label
(reader).
(setf doplus-env-skip-label)
(writer).
doplus-env-terminate-label
(reader).
(setf doplus-env-terminate-label)
(writer).
ensure-list
(function).
epilogue
(structure).
epilogue-form
(reader).
(setf epilogue-form)
(writer).
epilogue-p
(function).
expand-with-simple-destructuring
(function).
extract-variables
(function).
finalization
(structure).
finalization-form
(reader).
(setf finalization-form)
(writer).
finalization-p
(function).
find-generator
(function).
find-loop-in-env
(function).
generator
(structure).
generator-clauses
(reader).
(setf generator-clauses)
(writer).
generator-name
(reader).
(setf generator-name)
(writer).
generator-p
(function).
initialization
(structure).
initialization-form
(reader).
(setf initialization-form)
(writer).
initialization-p
(function).
make-accumulator
(function).
make-declaration
(function).
make-destructuring-form
(function).
make-doplus-env
(function).
make-generator
(function).
make-options
(function).
make-wrapper
(function).
options-map
(reader).
(setf options-map)
(writer).
options-p
(function).
prologue
(structure).
prologue-form
(reader).
(setf prologue-form)
(writer).
prologue-p
(function).
result
(structure).
result-form
(reader).
(setf result-form)
(writer).
result-p
(function).
step
(structure).
step-form
(reader).
(setf step-form)
(writer).
step-p
(function).
termination
(structure).
termination-condition
(reader).
(setf termination-condition)
(writer).
termination-p
(function).
until
(macro).
while
(macro).
with-atomic-updates
(macro).
with-atomic-updates*
(macro).
with-doplus-body
(macro).
without-atomic-updates
(macro).
wrapper
(structure).
wrapper-function
(reader).
(setf wrapper-function)
(writer).
wrapper-p
(function).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Specifies an accumulation clause. Refer to the manual for details.
Same as accumulating-into, but also returns the value of each <vars> at the end of the loop.
Synonym for in-vector.
Assigns to the iteration variable a value computed by evaluating FORM on each iteration, including the first. Optionally, the variable can be updated evaluating a differen form (the value of the ‘then’ parameter). Examples: (for x (being (random))), (for y (being ’quiet :then (if (> x 0.5) ’angry ’quiet))).
Collects a value into an accumulator. If no accumulator is provided, the default one for the current do+ loop is used.
Synonym for accumulating-to.
Same as collecting-into, but also returns the value of each <vars> at the end of the loop.
Counts the number of iterations, starting from 0.
Same as cl:defmacro, but additionally records <name> in *clauses* as a known clause macro.
High-level, extensible iteration construct. Refer to the manual for syntax and semantics.
Evaluates <form> after the last iteration, before returning a value.
Same as FOR, but perhaps nicer to read when used in conjunction with macros like MAXIMIZING.
General iteration clause. Its actual behaviour is controlled by ITERATION, a macro form that FOR expands with *ITERATION-VARIABLE* bound to VAR. Example: in (for x (in ’(1 2 3))), IN is a macro that expands into clauses that make use of *ITERATION-VARIABLE*, which is bound to the symbol X in the example. For certain iteration macros, VAR can be a lambda-list as well, in which case destructuring is applied. Example: (for (x &optional y) (in-list ’((1 2) (3)))).
Iterates from a given initial value to an optional maximum. Every iteration increments/decrements the value applying the <using> function (by default +) to the previous value and <by> (by default 1 or -1, depending on whether to >= from or not). Similarly, the <while> function is used to determine if <to> has been reached or surpassed. <while> is a function of two arguments, the current value and the value of <to>, and as soon as it returns false, the loop is terminated. <while> defaults to a function that returns true only if <to> has been specified and, letting cur be the current value, (<= (min to from) cur (max to from)).
Lazy version of FOR. The user must call UPDATE or TRY-UPDATE in the body of the DO+ form in order to compute new values for the variable(s). Initialization, instead, is *always* performed eagerly.
Iterates over the entries of a hash table. The iteration variables must be specified as (key value), for example: (for (lemma definitions) (hash-entries-of the-english-vocabulary)).
Iterates over a sequence. IN must be used in combination with FOR, GENERATING and similar macros (those that bind *ITERATION-VARIABLE*). In implementations with extensible sequences (currently ABCL and SBCL), native sequence iterators are used, and all sequence types are supported, not just lists and vectors. In other implementations, an iterator specialized for lists or vectors is used depending on the type of sequence. All ‘args‘ are passed down to make-sequence-iterator (see the extensible sequences API paper for details [Rhodes2007]). IN can perform destructuring.
Like IN, but specialized for lists. Successive lists are obtained by calling the function BY (which by default is #’CDR) on the previous list. REST, if specified, is the variable holding the remaining elements to be processed; REST initially is bound to the entire list, then to successive lists obtained by funcalling BY.
Loops across a vector. INDEX is bound to the index of the current element in the vector. The vector is traversed starting from index START (0 by default) to index END (the end of the vector if not specified); the index is incremented by BY (1 by default) on each iteration.
Evaluates <form> before the first iteration.
Loops over the successive tails of a list, checking for the end of the list as if by ATOM. Can perform destructuring.
Synonym for optimizing.
Same as optimizing but with < as the default test.
Finds the optimum value of an expression across the iteration. Refer to the manual for details.
On every iteration, the for-variable is set to the value <expr> had at the end of the previous iteration (initially NIL).
Returns each form in <forms> as the value of the do+ form when the loop ends. If multiple forms are specified, by one or more RETURNING clauses, multiple values are returned, in the order the corresponding forms appear lexically. If one of the <forms> is (cl:values ...), then each value will be returned as if the values were spelled as direct arguments of the RETURNING form.
Skips the current iteration. Refers to the current loop or, if loop-name is specified, to the closest surrounding loop with that name.
Synonym for until.
Syntactic sugar for collect, intended to be used when the accumulator computes a sum.
Specifies an accumulation strategy with 0 as the default value and + as the accumulator function.
Same as summing-to, but also returns the value of each <vars> at the end of the loop.
Iterates over the symbols in one or more packages. Symbol-types follows the specification of cl:with-package-iterator.
Immediately terminates the loop. Refers to the current loop or, if loop-name is specified and non-NIL, to the closest surrounding loop with that name. Can optionally specify a return value for the loop, which, if provided, will override the loop’s ordinary return value.
Variation over from.
Tries to update the generator named <var> as by UPDATE. If the loop would be terminated as a result of the update operation, it is not terminated.
Any errors occurring during the update are ignored by default; however, it is possible to provide a function to be invoked in case of error to determine what to do. This is the value of the <on-error> parameter, which, if provided, must be a function of two arguments: the first is the value to be returned as the result of the try-update form if the error is suppressed; the second is the condition object itself, which can be resignaled. Calling TERMINATE inside the function, if it is defined lexically inside the DO+ body, will regularly terminate the loop.
Updates the generator named <var>, calculating new value(s) for its variable(s) and evaluating its pre and post conditions, terminating the loop if they fail. If successful, the update returns the value of <var>.
Establishes bindings which are in effect for the whole loop.
General iteration clause generator.
Specialized iteration clause generator, where the iteration clause refers to a single variable, possibly with an initial value, step form, precondition, or postcondition.
A list of known symbols that name clause macros, useful for introspection and documentation purposes.
Causes the emission of a (declare <thing>) form in the declaration section of the loop.
Specifies a termination clause for the loop. When, at the beginning of an iteration, the clause evaluates to true, the loop stops.
Same as (until (not <condition>)).
var
.
var
.
form
.
(if (listp obj) obj (list obj))
form
.
Expand ‘form’ in ‘env’ as an iteration form that assigns to ‘*iteration-variable*’ destructuring as by ‘destructuring-bind’.
form
.
name
.
form
.
map
.
form
.
form
.
form
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
structure-object
.
common-lisp
.
structure-object
.
common-lisp
.
Jump to: | %
(
A B C D E F G H I L M O P R S T U W |
---|
Jump to: | %
(
A B C D E F G H I L M O P R S T U W |
---|
Jump to: | *
A C D F G L M N P S T V |
---|
Jump to: | *
A C D F G L M N P S T V |
---|
Jump to: | A B D E F G I O P R S T W |
---|
Jump to: | A B D E F G I O P R S T W |
---|