D-Programming-Language/phobos — pull request #992 by monarchdodra (2012-12-04 17:10:40+00:00)
Title: Update in chunks

Basically the old `if(isInputRange!Source && hasSlicing!Source && hasLength!Source)` was pretty much the same as "finite RA".

This implementation only requires `ForwardRange`. This means `chunks` can now be used with "simple" ranges, such as `byLine` (to read blocks of lines at once), or `filter`, or infinite ranges, both non-ra (Fib by blocks), or with RA and slicing (Sequence).

AFAIK, chunks requires *at least* forward: I don't think it could work on a input only.

Implementation wise, there is not much: slicing was basically just changed for `take`, and everything works just as well. I re-organized a bit so as to document what functions require what traits from `Source`. Finally, I improved on the implementations of `Back`/`popBack`/`Length`, simply by using more accurate arithmetics.

This pull currently works, but would require #854 to fully unlock the slicing functionality of infinite ranges, and requires #991 so as to test said functionality.