On Wednesday, 5 June 2013 at 17:36:05 UTC, Andrei Alexandrescu wrote:
itemize() takes a range of ranges of T and offers a range of T. For example, given a range of T[], offers a range of T.
joiner?

collect() takes a range of T and offers a range of T[]. The number of items in each chunk can be a parameter.
chunk? (or rather chunk(…).map!(a => a.array)).

I salute this code. It is concise, well engineered, well written, just as general as it needs, uses the right features in the right places, and does real work. A perfect example to follow. The only thing I'd add is this convenience function:

It also doesn't utilize template constraints, reinvents isRandomAccessRange && hasSlicing under a poor name, uses C printf (!) in the examples, has random 2-3 letter variable names (dis, dip, di, si) all over the place, …

David

Reply via email to