Standalone AA implementation ready for review (Was: Re:

H. S. Teoh hsteoh at quickfur.ath.cx
Fri Mar 16 10:02:22 PDT 2012


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.


More information about the Digitalmars-d mailing list