This is the for Reference Manual, version 1.2.0, generated automatically by Declt version 4.0 beta 2 "William Riker" on Sun Sep 15 05:12:26 2024 GMT+0.
The main system appears first, followed by any subsystem dependency.
for
An extensible iteration macro library.
Yukari Hafner <shinmera@tymoon.eu>
Yukari Hafner <shinmera@tymoon.eu>
(GIT https://github.com/Shinmera/for.git)
zlib
1.2.0
documentation-utils
(system).
lambda-fiddle
(system).
form-fiddle
(system).
package.lisp
(file).
toolkit.lisp
(file).
binding.lisp
(file).
clause.lisp
(file).
for.lisp
(file).
iterator.lisp
(file).
standard.lisp
(file).
documentation.lisp
(file).
Files are sorted by type and then listed depth-first from the systems components trees.
for/for.asd
for/package.lisp
for/toolkit.lisp
for/binding.lisp
for/clause.lisp
for/for.lisp
for/iterator.lisp
for/standard.lisp
for/documentation.lisp
for/toolkit.lisp
package.lisp
(file).
for
(system).
hash-table-iterator
(function).
package-iterator
(function).
update
(macro).
with-interleaving
(macro).
collect-for-values
(function).
copy-list*
(function).
delist
(function).
enlist
(function).
replace-lambda-vars
(function).
unwind-protect*
(macro).
values*
(macro).
for/binding.lisp
toolkit.lisp
(file).
for
(system).
binding
(function).
(setf binding)
(function).
define-accumulation-binding
(macro).
define-alias-binding
(macro).
define-direct-binding
(macro).
define-form-binding
(macro).
define-form-symbol-macro-binding
(macro).
define-value-binding
(macro).
define-value-symbol-macro-binding
(macro).
remove-binding
(function).
*bindings*
(special variable).
bindings-for-gens
(function).
compute-binding-parts
(function).
compute-declaration-parts
(function).
convert-bindings
(function).
emit-binding-definition
(function).
normalize-declaration-inner
(function).
normalize-declarations
(function).
translate-form-vars
(function).
for/clause.lisp
binding.lisp
(file).
for
(system).
clause
(function).
(setf clause)
(function).
remove-clause
(function).
*clauses*
(special variable).
convert-clauses
(function).
define-direct-clause
(macro).
define-simple-clause
(macro).
for/for.lisp
clause.lisp
(file).
for
(system).
for
(macro).
*environment*
(special variable).
with-for-block
(macro).
with-for-tagbody
(macro).
for/iterator.lisp
for.lisp
(file).
for
(system).
array-iterator
(class).
buffer
(reader method).
buffer
(reader method).
(setf buffer)
(writer method).
(setf buffer)
(writer method).
close-stream
(reader method).
close-stream
(reader method).
(setf close-stream)
(writer method).
(setf close-stream)
(writer method).
current
(generic reader).
(setf current)
(generic function).
directory-iterator
(class).
end
(generic function).
has-more
(generic function).
hash-table-iterator
(class).
index
(reader method).
(setf index)
(writer method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
initialize-instance
(method).
iterator
(reader method).
iterator
(reader method).
(setf iterator)
(writer method).
(setf iterator)
(writer method).
iterator
(class).
limit
(reader method).
limit
(reader method).
(setf limit)
(writer method).
list-iterator
(class).
make-iterator
(generic function).
next
(generic function).
object
(reader method).
(setf object)
(writer method).
package-iterator
(class).
prefetch
(reader method).
prefetch
(reader method).
(setf prefetch)
(writer method).
(setf prefetch)
(writer method).
random-iterator
(class).
sequence-iterator
(class).
start
(reader method).
(setf start)
(writer method).
step-functions
(generic function).
stream-iterator
(class).
stream-line-iterator
(class).
total-length
(reader method).
(setf total-length)
(writer method).
vector-iterator
(class).
for/standard.lisp
iterator.lisp
(file).
for
(system).
*unbound*
(special variable).
remove-bindings
(function).
Packages are listed by definition order.
for-minimal
org.shirakumo.for.minimal
common-lisp
.
for
.
for-iterator
org.shirakumo.for.iterator
common-lisp
.
for
.
array-iterator
(class).
buffer
(generic reader).
(setf buffer)
(generic writer).
close-stream
(generic reader).
(setf close-stream)
(generic writer).
current
(generic reader).
(setf current)
(generic function).
directory-iterator
(class).
end
(generic function).
has-more
(generic function).
hash-table-iterator
(function).
hash-table-iterator
(class).
index
(generic reader).
(setf index)
(generic writer).
iterator
(generic reader).
(setf iterator)
(generic writer).
iterator
(class).
limit
(generic reader).
(setf limit)
(generic writer).
list-iterator
(class).
make-iterator
(generic function).
next
(generic function).
object
(generic reader).
(setf object)
(generic writer).
package-iterator
(function).
package-iterator
(class).
prefetch
(generic reader).
(setf prefetch)
(generic writer).
random-iterator
(class).
sequence-iterator
(class).
start
(generic reader).
(setf start)
(generic writer).
step-functions
(generic function).
stream-iterator
(class).
stream-line-iterator
(class).
total-length
(generic reader).
(setf total-length)
(generic writer).
vector-iterator
(class).
for
org.shirakumo.for
common-lisp
.
for-iterator
.
for-minimal
.
binding
(function).
(setf binding)
(function).
clause
(function).
(setf clause)
(function).
define-accumulation-binding
(macro).
define-alias-binding
(macro).
define-direct-binding
(macro).
define-form-binding
(macro).
define-form-symbol-macro-binding
(macro).
define-value-binding
(macro).
define-value-symbol-macro-binding
(macro).
remove-binding
(function).
remove-clause
(function).
with-interleaving
(macro).
*bindings*
(special variable).
*clauses*
(special variable).
*environment*
(special variable).
*unbound*
(special variable).
bindings-for-gens
(function).
collect-for-values
(function).
compute-binding-parts
(function).
compute-declaration-parts
(function).
convert-bindings
(function).
convert-clauses
(function).
copy-list*
(function).
define-direct-clause
(macro).
define-simple-clause
(macro).
delist
(function).
emit-binding-definition
(function).
enlist
(function).
normalize-declaration-inner
(function).
normalize-declarations
(function).
remove-bindings
(function).
replace-lambda-vars
(function).
translate-form-vars
(function).
unwind-protect*
(macro).
values*
(macro).
with-for-block
(macro).
with-for-tagbody
(macro).
Definitions are sorted by export status, category, package, and then by lexicographic order.
Defines a binding for an accumulator.
This is identical to DEFINE-FORM-BINDING with the exception that the secondary value is set to a (RETURN-FOR var) for you, meaning the variable’s contents are returned from the FOR upon normal termination.
See DEFINE-FORM-BINDING
for
.
Defines an alias for a binding.
See BINDING
for
.
Defines a binding function.
Binding functions can return three values:
1. A single "surrounding form" that will go around the resulting loop. If you
require multiple surrounding forms, you can use WITH-INTERLEAVING.
2. A form to run during each iteration. They will be run before any body forms.
3. A form whose value is returned by the FOR.
4. A form to run during each iteration. They will be run *after* any body forms.
The arguments that the function receives are directly translated from the
respective binding expression. One argument will always be passed in the
very least: the variable specified for the binding.
Note that a binding function receives its arguments as literals and thus must
process them like a macro would (destructive operations are bad juju).
Also note that unlike normal functions, the &environment lambda-list argument
is available and its value will be passed on from the calling FOR macro.
See BINDING
See REMOVE-BINDING
for
.
Defines a binding that receives its arguments as literals.
&AUX variables in the ARGS lambda-list receive special treatment: they are
bound to gensyms within the definition body. Their value is only evaluated
and set within the expanded binding. This means that &AUX variables give you a
convenient way to introduce necessary helper variables to the expanded binding.
References to other AUX variables or the VAR are automatically rewritten to
the appropriate gensym.
VAR can also accept a default value, which receives the same semantic treatment
as &AUX variables do, with the exception that it is always the last binding to
be evaluated in the resulting expansion, meaning every other &AUX variable can
be referenced.
The primary value returned must be the form to be evaluated on each iteration.
A secondary value may be returned, which is a form to be evaluated when the
loop ends normally.
See DEFINE-DIRECT-BINDING
See DEFINE-VALUE-BINDING
for
.
Defines a binding that receives its arguments as literals and treats the VAR as a symbol-macro.
This is the exact same as DEFINE-FORM-BINDING with the exception that the
VAR is translated into a symbol-macro binding. Its value is still translated
accordingly to make sure references to AUX variables stay intact.
See DEFINE-FORM-BINDING
for
.
Defines a binding that receives its arguments as values.
The treatment of all arguments in the ARGS lambda-list is as follows:
Within the definition body, they are bound to gensyms. Upon expansion of the
binding, each variable is expanded to a variable binding with the respective
value that was passed to the binding definition. Special exception is made for
the present-p optional variables that can be specified for optional or key
arguments, which are bound as usual in the definition body such that expansion
may be aware of which parameters were passed. In essence, you can interpret all
arguments as if treated by ONCE-ONLY.
&AUX variables in the args lambda-list receive special treatment: they are
bound to gensyms within the definition body. Their value is only evaluated
and set within the expanded binding. This means that AUX variables give you a
convenient way to introduce necessary helper variables to the expanded binding.
References to other arguments or the VAR are automatically rewritten to
the appropriate gensym.
VAR can also accept a default value, which receives the same semantic treatment
as &AUX variables do, with the exception that it is always the last binding to
be evaluated in the resulting expansion, meaning every other argument can
be referenced.
The primary value returned must be the form to be evaluated on each iteration.
A secondary value may be returned, which is a form to be evaluated when the
loop ends normally.
See DEFINE-FORM-BINDING
See DEFINE-DIRECT-BINDING
for
.
Defines a binding that receives its arguments as values and treats the VAR as a symbol-macro.
This is the exact same as DEFINE-VALUE-BINDING with the exception that the
VAR is translated into a symbol-macro binding. Its value is still translated
accordingly to make sure references to arguments stay intact.
See DEFINE-VALUE-BINDING
for
.
Loops the body with the given bindings established.
Each binding should have the form (var binding-type args*)
Sometimes a var can be either a single symbol denoting a variable, or a
lambda-list to which the result is destructured and bound via UPDATE.
The support thereof depends on the binding construct.
Within the body, special iteration clauses may be present. A clause must appear
at the "top-level" of the body and cannot appear as a macro-expansion.
If the loop is terminated normally by END-FOR then multiple values may be returned
depending on how many bindings or clauses are present that want to return values.
The order of the values is as follows: the clause values are returned in the
order that the clauses appear in the body, followed by the binding values in the
order of the binding expressions.
The loop may also be terminated abnormally by a direct call to RETURN-FOR or RETURN.
See UPDATE
See BINDING
See CLAUSE
See END-FOR
See SKIP-FOR
See RETURN-FOR
See WITH-FOR-TAGBODY
See WITH-FOR-BLOCK
See CONVERT-BINDINGS
See CONVERT-CLAUSES
Allows updating the PLACE with a new value.
Unlike just (setf place value), PLACE can also be a lambda-list where each variable is then properly updated with the respective element from value list.
Interleave the body forms.
Essentially this means that the last form is appended to the form before it and this is then appended to the form before that, and so on.
for
.
Accessor to the function that compiles the given binding.
If there is no binding named by the given symbol directly, another search is performed using the symbol with the same symbol-name from the FOR package.
See REMOVE-BINDING
for
.
Accessor to the function that compiles the given clause.
If there is no clause named by the given symbol directly, another search is performed using the symbol with the same symbol-name from the FOR package.
See REMOVE-CLAUSE
for
.
Returns a function to iterate over a hash-table.
See CL:WITH-HASH-TABLE-ITERATOR
Returns a function to iterate over a package’s symbols.
See CL:WITH-PACKAGE-ITERATOR
Removes the given binding function.
See BINDING
for
.
Accessor to the stream-iterator’s buffer.
See STREAM-ITERATOR
stream-line-iterator
)) ¶automatically generated reader method
stream-iterator
)) ¶automatically generated reader method
stream-line-iterator
)) ¶automatically generated writer method
stream-iterator
)) ¶automatically generated writer method
Accessor to whether the stream should be closed on END call or not.
See STREAM-ITERATOR
See STREAM-LINE-ITERATOR
stream-line-iterator
)) ¶automatically generated reader method
stream-iterator
)) ¶automatically generated reader method
stream-line-iterator
)) ¶automatically generated writer method
stream-iterator
)) ¶automatically generated writer method
Accessor to the current item of the iterator.
The behaviour is undefined if CURRENT is used before NEXT has been called for a first time.
Some (but not all) iterators may support setting the current element to a new value.
See NEXT
hash-table-iterator
)) ¶stream-iterator
)) ¶stream-iterator
)) ¶stream-iterator
)) ¶sequence-iterator
)) ¶array-iterator
)) ¶vector-iterator
)) ¶list-iterator
)) ¶Ends the iterator and performs potential cleanup.
You should always call this function with your iterator object once you are done to ensure proper termination.
stream-line-iterator
)) ¶stream-iterator
)) ¶Returns a generalised boolean indicating whether the iterator has more items or not.
hash-table-iterator
)) ¶package-iterator
)) ¶random-iterator
)) ¶stream-line-iterator
)) ¶stream-iterator
)) ¶sequence-iterator
)) ¶array-iterator
)) ¶vector-iterator
)) ¶list-iterator
)) ¶Accessor to the current index within the buffer.
See STREAM-ITERATOR
stream-iterator
)) ¶automatically generated reader method
stream-iterator
)) ¶automatically generated writer method
hash-table-iterator
)) ¶automatically generated reader method
sequence-iterator
)) ¶automatically generated reader method
hash-table-iterator
)) ¶automatically generated writer method
sequence-iterator
)) ¶automatically generated writer method
Accessor to the amount of data that is currently filled in the buffer.
See STREAM-ITERATOR
random-iterator
)) ¶automatically generated reader method
stream-iterator
)) ¶automatically generated reader method
stream-iterator
)) ¶automatically generated writer method
Create an iterator object for the given type of object.
hash-table
) &key) ¶package
) &key) ¶random-state
) &key limit) ¶pathname
) &key buffer-size element-type) ¶stream
) &key buffer-size close-stream) ¶sequence
) &key) ¶array
) &key start) ¶vector
) &key start) ¶list
) &key) ¶Advances the iterator by one item and returns the new item.
The behaviour is undefined if the iterator does not have more items.
See HAS-MORE
hash-table-iterator
)) ¶package-iterator
)) ¶random-iterator
)) ¶stream-line-iterator
)) ¶stream-iterator
)) ¶sequence-iterator
)) ¶array-iterator
)) ¶vector-iterator
)) ¶list-iterator
)) ¶Accessor to the data structure the iterator is iterating over.
Note that this is not necessarily the same object as what was passed into the constructor of the iterator. The iterator is free to modify this slot as it sees fit.
See ITERATOR
Cache for the next value
Since the iterator constructs provided by CL do not allow merely testing whether a next element is available without losing it if there is one, we must cache the value on a HAS-MORE call and then use that on NEXT instead of calling the iterator function twice.
See PACKAGE-ITERATOR
See HASH-TABLE-ITERATOR
hash-table-iterator
)) ¶automatically generated reader method
package-iterator
)) ¶automatically generated reader method
hash-table-iterator
)) ¶automatically generated writer method
package-iterator
)) ¶automatically generated writer method
Accessor to the index that points to the next element of the vector-iterator.
vector-iterator
)) ¶automatically generated reader method
vector-iterator
)) ¶automatically generated writer method
Returns a set of functions to perform the iteration.
Returns four values:
NEXT — Function of zero arguments that returns the next element.
HAS-MORE — Function of zero arguments that returns whether there are
more elements available.
UPDATE — Function of one argument that sets the current element to
the given value if possible.
END — Function of zero arguments to finalise the iteration.
Iterators may specialise on this method to return tailored stepping functions that avoid the CLOS dispatch cost. Note that calling these functions may or may not change the internal iterator state.
hash-table-iterator
)) ¶package-iterator
)) ¶random-iterator
)) ¶stream-line-iterator
)) ¶stream-iterator
)) ¶sequence-iterator
)) ¶array-iterator
)) ¶vector-iterator
)) ¶list-iterator
)) ¶Slot holding the array-total-size.
See ARRAY-ITERATOR
array-iterator
)) ¶automatically generated reader method
array-iterator
)) ¶automatically generated writer method
stream-iterator
) &key buffer-size object) ¶package-iterator
) &key object status) ¶directory-iterator
) &key object) ¶array-iterator
) &key object) ¶sequence-iterator
) &key object start end) ¶list-iterator
) &key object) ¶hash-table-iterator
) &key object) ¶Iterator for general arrays.
Iteration is in row-major order.
Supports setting the current element.
See VECTOR-ITERATOR
See TOTAL-LENGTH
Iterator for a DIRECTORY listing.
On construction, this performs a simple DIRECTORY call on the given object
and then iterates over the result list of pathnames. Thus, the pathname must
be wild.
See LIST-ITERATOR
Iterator for the key/value pairs in a package.
Each value returned by this iterator’s CURRENT/NEXT is always a list of two values, the
respective key and its value.
Supports setting the current element.
See PREFETCH
See ITERATOR
An iterator is responsible for iterating over a given data structure.
See HAS-MORE
See NEXT
See CURRENT
See MAKE-ITERATOR
See OBJECT
Iterator for proper lists.
Supports setting the current element.
See ITERATOR
Iterator for the symbols in a package.
The type of symbols that are iterated can be set through the :STATUS initarg, which must
be a list containing any of the following keywords: :INTERNAL :EXTERNAL :INHERITED
See PREFETCH
See ITERATOR
Initarg | Value |
---|---|
:status | (quote (internal external inherited)) |
Iterator for random numbers.
This iterator can be constructed through a RANDOM-STATE object. The argument for RANDOM
that determines its limit can be passed through the :LIMIT initarg.
See ITERATOR
Initarg | Value |
---|---|
:limit | 1.0 |
Iterator for input streams.
The stream is read through a buffer, the size of which can be set via the :BUFFER-SIZE initarg. If :CLOSE-STREAM is set to non-NIL, CLOSE is performed on the stream upon END.
Supports setting the "current" element if the stream supports writing to it of course.
See BUFFER
See INDEX
See LIMIT
See ITERATOR
Iterator for line based input streams.
If :CLOSE-STREAM is set to non-NIL, CLOSE is performed on the stream upon END.
See BUFFER
See CLOSE-STREAM
See ITERATOR
Iterator for vectors.
Supports setting the current element.
See START
See ITERATOR
Initarg | Value |
---|---|
:start | 0 |
:start
This variable will be bound to the environment object during the expansion of the FOR macro.
Defines a clause function.
Clause functions can return three values:
1. A single "surrounding form" that will go around the resulting loop. If you
require multiple surrounding forms, you can use WITH-INTERLEAVING.
2. A form to run during each iteration.
3. A form whose value is returned by the FOR.
The arguments that the function receives are directly translated from the
respective clause expression.
Note that a clause function receives its arguments as literals and thus must
process them like a macro would (destructive operations are bad juju).
Also note that unlike normal functions, the &environment lambda-list argument
is available and its value will be passed on from the calling FOR macro.
See CLAUSE
See REMOVE-CLAUSE
for
.
Defines a simple clause.
&AUX variables in the args lambda-list receive special treatment: they are bound to gensyms within the definition body. Their value is only evaluated and set within the expanded clause. This means that AUX variables give you a convenient way to introduce necessary helper variables to the expanded clause. References to other &AUX are automatically rewritten to the appropriate gensym.
The primary value returned must be the form to be evaluated on each iteration.
A secondary value may be returned, which is a form to be evaluated when the
loop ends normally.
See DEFINE-DIRECT-CLAUSE
for
.
Wraps the body in a looping block.
This establishes a NIL block.
See RETURN-FOR
Wraps the body in a looping tagbody, running the EXIT forms when the loop ends.
See END-FOR
See SKIP-FOR
Translates the given binding expressions into their respective parts.
Each binding must be a list of the following structure:
BINDING ::= (PLACE binding-type argument*)
PLACE ::= variable | lambda-list
variable — A symbol naming a variable to bind the result of the binding to.
lambda-list — If the binding result is a list, destructure it by this lambda-
list, binding the respective symbols.
binding-type — The type of binding determines how the PLACE is initialised and
how it changes each iteration.
argument — An argument to the binding. Depending on the binding it may be
evaluated once or in every iteration.
If an unknown binding is referenced, an error is signalled.
Returns three values:
1. A list of all surrounding forms
2. A list of all body forms
3. A list of all value forms
See BINDING
for
.
Translates the given body forms into their respective parts.
If a body form is noticed that matches a clause –by virtue of being a list and
the first item thereof being a symbol that translates to a clause name– then it
is replaced by the form computed by the clause function.
Returns three values:
1. A list of all surrounding forms
2. A list of all body forms
3. A list of all value forms
See CLAUSE
for
.
Same as COPY-LIST, but also returning the last cons of the new list as a second value.
for
.
If A is a list, return the element that KEY retrieves.
for
.
for
.
If A is not a list, turn it into one with the given ELS as further items.
for
.
Replaces all VARS in LAMBDA-LIST with the NEW-VAR at the same position.
for
.
Jump to: | (
B C D E F G H I L M N O P R S T U V W |
---|
Jump to: | (
B C D E F G H I L M N O P R S T U V W |
---|
Jump to: | *
B C I L O P S T |
---|
Jump to: | *
B C I L O P S T |
---|
Jump to: | A B C D F H I L P R S T V |
---|
Jump to: | A B C D F H I L P R S T V |
---|