On 6/5/13 2:36 PM, David Nadlinger wrote:
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 prefer to avoid the name chunk because (a) it's both a noun and a verb, and (b) it's already alluded to in File.byChunk which is a related but different functionality.

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, …

Nobody's perfect!


Andrei

Reply via email to