scala/scala — pull request #4086 by som-snytt (2014-11-01 20:21:03+00:00)
Title: SI-8835 Lazier slice for Iterator

An iterator for slicing that does not drop eagerly.

A series of `take m drop n` that results in nothing taken
will not call the underlying iterator.

Chained invocations do not create intermediate iterators.

This PR against 2.12 (because of the change to laziness)
includes the expanded unit test from #4075, but does not
delete the redundant test files.

This is similar to a proposal at #3963: just track drop and take numbers (skip and limit counters) until forced.

There may be a question whether this is worth it, in the space between deprecated views and the collections getting rewritten by multiple parties.

The other question is, if `take` and `drop` and `slice` are defined in terms of a template method, should they be final?

Review by @Ichoran