Overview:
This package provides a new keyword for iterate, per
,
and four styles of iteration:
(iter (per x in y))
similar to doseq, binds x to each element of
the result of calling seq
on y.
(iter (per x on y))
similar to loop .. on
, binds x to subsequent
tails
of the result of calling seq
on y.
(iter (per x across y))
similar to loop .. across
, calls indexable
on y,
and loops by index below count-elements
binding x to
subsequent values of element-at
(iter (per x of y))
similar to do-iterator, calls iterator
on
y, and binds x to subsequent values it produces. ensures that
iterator-finish!
is called. since iterator
provides a default
implementation for seq
, indexable
, and associative
, any of
those may also be used in a per ... of
clause.
Usage: This package is intended to be used with iterate. Since Iterate tests clauses on symbol-equality, this package will have no effect unless you explicitly :use it, e.g.
(defpackage #:foo
(:use #:cl
#:iterate
#:com.clearly-useful.iterate+))
this package exports two symbols.
iterate driver
iterate keyword