Liking cljdoc? Tell your friends :D

ham-fisted.iterator

Generialized efficient pathways involving iterators.

Generialized efficient pathways involving iterators.
raw docstring

->iteratorclj

(->iterator item)

Convert a stream, supplier, or an iterable into an iterator.

Convert a stream, supplier, or an iterable into an iterator.
raw docstring

ary-iterclj

(ary-iter ary-data)

Create an iterator for any primitive or object java array.

Create an iterator for any primitive or object java array.
raw docstring

blocking-queue->iterableclj

(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.
raw docstring

const-iterableclj

(const-iterable arg)

Return an iterable that always returns a arg.

Return an iterable that always returns a arg.
raw docstring

current-iteratorclj

(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.
raw docstring

doitercljmacro

(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.
raw docstring

has-next?clj

(has-next? iter)

Given an iterator or nil return true if the iterator has next.

Given an iterator or nil return true if the iterator has next.
raw docstring

iter-consclj

(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.
raw docstring

iterableclj

(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.

  • 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
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
raw docstring

linear-merge-iteratorclj

(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.
raw docstring

maybe-nextclj

(maybe-next iter)

Given an iterator or nil return the next element if the iterator hasNext.

Given an iterator or nil return the next element if the iterator hasNext.
raw docstring

merge-iterableclj

(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.
raw docstring

non-nil?clj

(non-nil? a)

once-iterableclj

(once-iterable init-fn)
(once-iterable valid? init-fn)
(once-iterable valid? init-fn update-fn val-fn)

Create an iterable that can only be iterated once - it always returns the same (non threadsafe) iterator every iterator call. 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
Create an iterable that can only be iterated once - it always returns the same (non threadsafe) iterator
every `iterator` call.  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
raw docstring

seq-iterableclj

(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.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close