(The mysterious undocumented Iter class...)

    Iter.count(iterator)

but remember the iterator is consumed by the calls and is .hasNext()==false afterwards.

Iter has many things for iterator. Filter, map, transform, reduce, fold, concat, ...

        Andy

On 11/01/11 14:08, Benson Margulies wrote:
I found myself writing an iteration down an iterator just to count the
things it covered. Firing up ARQ for count(*) seemed like overkill.
Would it be reasonable to suggest that the listX apis have
corresponding countX, or that iterators be prepared to return a count?

Reply via email to