map & filter for AAs

2011-02-08 Thread spir
Hello, Is there map & filter for AAs? Is it useful? Below example, Denis struct Pair (K,V) { K k; V v; } V2[K2] map (K1,V1, K2,V2) (V1[K1] aa1, Pair!(K2,V2) delegate (K1,V1) f) { V2[K2] aa2; Pair!(K2,V2) pair; foreach (k,v ; aa1) { pair = f(k,v); aa2[pa

Re: map & filter for AAs

2011-02-08 Thread bearophile
spir: > Is there map & filter for AAs? Is it useful? Of course it's useful to map and filter on associative arrays. But I think a much better solution is to turn byValue() and byKey() into ranges, and add a byPair() range to AAs: http://d.puremagic.com/issues/show_bug.cgi?