On Fri, Mar 16, 2012 at 08:25:08AM -0400, bearophile wrote: > H. S. Teoh: > > > Alright, I've made a preliminary implementation of AA literals as a > > function that constructs an AA given an array of keys and and an array > > of values (just like the current aaA.d implementation). > > See also: > http://d.puremagic.com/issues/show_bug.cgi?id=5502 > http://d.puremagic.com/issues/show_bug.cgi?id=5466 [...]
I took a look at these issues, but they seem tricky to implement in druntime because they depend on phobos features. So probably constructing an AA from zip() should be in phobos; the current AA methods should be already be good enough for implementing this. For iterating AA's as key/value pairs, though, I'll have to think about how to do it in a nice way. Internally, there's already a Range struct that iterates by Slot (which amounts to the same thing as iterating by pairs), so it's just a matter of exposing this in the right way to the phobos code that will implement by-pair iteration. T -- This is a tpyo.