Skip to content

clojure.core/iterator-seq

View this page on ClojureDocs

Type: function Added: Clojure 1.0 Examples: 2 Runnable: 0
([iter])

Returns a seq on a java.util.Iterator. Note that most collections providing iterators implement Iterable and thus support seq directly. Seqs cache values, thus iterator-seq should not be used on any iterator that repeatedly returns the same mutable object.

Examples

by gstamp on . May have evaluation errors.
by reborg on . May have evaluation errors.

Note by dakrone

I've noticed that I needed to use iterator-seq when trying to map over a Java function that returns an AbstractList Iterator. It was not directly seq-able.

See also


Content from the matching ClojureDocs page, with authors credited on each contribution.