On Wednesday, 28 May 2014 at 11:40:05 UTC, Wanderer wrote:
Sorry about typo, I meant
providor_symbol_map.sort!((x,y)=>{x.value.length>y.value.length})
above.
providor_symbol_map is an Associative Array, so you can't sort
that. *Usually*, you want to do what the OP did, which is to get
the keys, and sort them, but leave the AA unchanged. EG:
Val[Key] myAA;
Key[] mySortedKeys = myAA.keys.sort!((x, y)=> compare(myAA[x],
myAA[y]))()
//Print values in incremented order:
foreach(key; mySortedKeys)
writefln("%s: %s", key, myAA[key]);