Iterators

Iteration

iter

Constructs an iterator over a collection.

iter-next!

Advances an iterator.

iter-next-back!

Advances the back of a double-ended iterator.

iter-finished?

Returns #t if an iterator has no more items to produce.

iter-double-ended?

Returns #t if an iterator can be advanced from the back.

Basic Iterators

rn

Iterates over a numeric range.

rni

Iterates over an inclusive numeric range.

once

Iterates over zero or more arguments.

once-with

Returns an iterator which lazily calls a function.

repeat

Returns an iterator which infinitely yields its arguments.

repeat-with

Returns an iterator which repeatedly calls a function.

chunks

Iterates over non-overlapping sub-arrays.

chunks-exact

Iterates over non-overlapping sub-arrays with an exact size.

rchunks

Iterates over non-overlapping sub-arrays, in reverse order.

rchunks-exact

Iterates over non-overlapping sub-arrays with an exact size, in reverse order.

windows

Iterates over overlapping sub-arrays.

lines

Iterates over lines in a string.

split

Iterates over sub-strings.

keys

Iterates over the keys of a table.

values

Iterates over the values of a table.

Iterator Adapters

rev

Reverses an iterator.

enumerate

Counts an iterator's items as they're yielded.

cloned

Clones another iterator's items.

deep-cloned

Recursively clones another iterator's items.

step-by

Skips over another iterator's items by the given interval.

map

Calls a function for each of another iterator's items.

filter

Discards items from another iterator which fail to match a predicate.

zip

Combines multiple iterators.

chain

Sequences multiple iterators, one after another.

flatten

Flattens nested structure.

cycle

Repeats another iterator indefinitely.

take

Limits another iterator to a fixed number of items.

take-while

Limits another iterator using a predicate.

skip

Skips a fixed number of leading items from another iterator.

skip-while

Skips leading items which match a predicate.

Iterator Consumers

count

Consumes an iterator, counting its items.

nth

Returns an iterator's nth item.

nth-back

Returns a double-ended iterator's nth-from-last item.

any?

Lazily tests whether any of an iterator's items match a predicate.

all?

Lazily tests whether all of an iterator's items match a predicate.

find

Returns the first of an iterator's items which match a predicate.

rfind

Returns the first of an iterator's items which match a predicate, searching backwards.

fold

Passes all of an iterator's items to an accumulator function.

rfold

Passes all of an iterator's items to an accumulator function in reverse order.

Strings and Text
Objects and Classes