Improving std.range.Zip

KennyTM~ kennytm at gmail.com
Sun Oct 24 23:42:31 PDT 2010


On Oct 25, 10 14:04, Andrei Alexandrescu wrote:
> This is coming full circle. At a point, map _did_ support multiple
> ranges. Some people found that non-modular - if you want multiple
> ranges, you should use map with zip...

Except that at "that point"[1], map's multi-range support is equivalent to

     map!(func)(r1, r2, r3...) ==  map!(func)(chain(r1, r2, r3...))

which is hardly useful. OTOH zipWithN is a very useful higher-order 
function.

[1]: 
http://web.archive.org/web/20080417051734/www.digitalmars.com/d/2.0/phobos/std_algorithm.html#map


More information about the Digitalmars-d mailing list