Another task

bearophile bearophileHUGS at lycos.com
Wed Jan 19 17:40:29 PST 2011


Simen kjaeraas:

> Why use map()? The correct solution for this looks like so:
> 
> 
> import std.range;
> 
> void main( ) {
>      auto aa = [1:"a", 2:"b", 3:"c"];
>      auto result = zip( aa.keys, aa.values );
> }

That result is not the requested one:
[(10,"aa"), (30,"bb"), (50,"cc")]
And that result is not generated by lazily as the task asks (keys and values return true arrays).

Bye,
bearophile


More information about the Digitalmars-d mailing list