Generialized efficient pathways involving iterators.
Generialized efficient pathways involving iterators.
(->iterator item)Convert a stream or an iterable into an iterator.
Convert a stream or an iterable into an iterator.
(ary-iter ary-data)Create an iterator for any primitive or object java array.
Create an iterator for any primitive or object java array.
(blocking-queue->iterable queue term-symbol)(blocking-queue->iterable queue timeout-us timeout-symbol term-symbol)Given a blocking queue return an iterable that iterates until queue returns term-symbol. Uses take to block indefinitely -- will throw any throwable that comes out of the queue.
Given a blocking queue return an iterable that iterates until queue returns term-symbol. Uses take to block indefinitely -- will throw any throwable that comes out of the queue.
(const-iterable arg)Return an iterable that always returns a arg.
Return an iterable that always returns a arg.
(current-iterator item)Return a current iterator - and iterator that retains the current object. This iterator is positioned just before the first object so it's current item is nil.
Return a current iterator - and iterator that retains the current object. This iterator is positioned just before the first object so it's current item is nil.
(doiter varname iterable & body)Execute body for every item in the iterable. Expecting side effects, returns nil.
Execute body for every item in the iterable. Expecting side effects, returns nil.
(has-next? iter)(iter-cons vv iter)Produce a new iterator that points to vv then defers to passed in iterator.
Produce a new iterator that points to vv then defers to passed in iterator.
(iterable init-fn update-fn)(iterable valid? init-fn update-fn val-fn)Create an iterable. init-fn is not called until the first has-next call.
Create an iterable. init-fn is not called until the first has-next call. * valid? - ctx->boolean - defaults to non-nil? * init-fn - creates new ctx * update-fn - function from ctx->ctx * val-fn - function from ctx->val - defaults to deref
(linear-merge-iterator iterators)(linear-merge-iterator cmp iterators)(linear-merge-iterator cmp p iterators)Create a merging iterator - fast for N < 8.
Create a merging iterator - fast for N < 8.
(maybe-next iter)(merge-iterable cmp iterables)Create an efficient n-way merge between a sequence of iterables using comparator. If iterables themselves are sorted result will be sorted.
Create an efficient n-way merge between a sequence of iterables using comparator. If iterables themselves are sorted result will be sorted.
(once-iterable init-fn)(once-iterable valid? init-fn)(once-iterable valid? init-fn update-fn val-fn)Create an iterable. init-fn is not called until the first has-next call - also see iterable.
The arguments have different defaults as once-iterables can close over global context on construction as they can only be iterated once.
Create an iterable. init-fn is not called until the first has-next call - also see [[iterable]]. The arguments have different defaults as once-iterables can close over global context on construction as they can only be iterated once. * valid? - ctx->boolean - defaults to non-nil? * init-fn - creates new ctx * update-fn - function from ctx->ctx - defaults to init-fn ignoring argument. * val-fn - function from ctx->val - defaults to identity
(seq-iterable iterable)Iterable with efficient reduce but also contains a cached seq conversion so patterns like: (when (seq v) ...) still work without needing to dereference the iterable twice.
Iterable with efficient reduce but also contains a cached seq conversion so patterns like: (when (seq v) ...) still work without needing to dereference the iterable twice.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |