www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Status of AA's?

reply "Rob T" <alanb ucora.com> writes:
I recall some discussion about AA's being buggy and fixing the 
bugs is difficult, and that there may be future changes to how 
AA's operate, for example perhaps moving it to a library solution.

So I am wondering if I should simply avoid using the built-in 
AA's entirely at this time, and instead create my own custom 
solution, or maybe there is a stable AA alternative already 
available?

Can anyone shed some light on what direction I should take?

Thanks!

--rt
Mar 28 2013
next sibling parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
28-Mar-2013 23:45, Rob T пишет:
 I recall some discussion about AA's being buggy and fixing the bugs is
 difficult, and that there may be future changes to how AA's operate, for
 example perhaps moving it to a library solution.

 So I am wondering if I should simply avoid using the built-in AA's
 entirely at this time, and instead create my own custom solution, or
 maybe there is a stable AA alternative already available?

 Can anyone shed some light on what direction I should take?
I'd roll my own (in fact did not very reusable yet). The built-in ones are a minefield for anything more complex then a dictionary of string->int :) Alternatively take a look at D collections: https://github.com/schveiguy/dcollections -- Dmitry Olshansky
Mar 28 2013
parent reply 1100110 <0b1100110 gmail.com> writes:
On 03/28/2013 03:05 PM, Dmitry Olshansky wrote:
 The built-in ones are a minefield for anything more complex then a
 dictionary of string->int :)
Please, last I checked, they were still a minefield for that... Random crashes, basic issues with the type system... I just stopped using them... But that's not very helpful. So if someone wants to tell me what I can do to help fix it, I'll do whatever I can. Just... ya know. order me around and such.
Mar 28 2013
parent reply Dmitry Olshansky <dmitry.olsh gmail.com> writes:
29-Mar-2013 00:54, 1100110 пишет:
 On 03/28/2013 03:05 PM, Dmitry Olshansky wrote:
 The built-in ones are a minefield for anything more complex then a
 dictionary of string->int :)
Please, last I checked, they were still a minefield for that... Random crashes, basic issues with the type system... I just stopped using them... But that's not very helpful. So if someone wants to tell me what I can do to help fix it, I'll do whatever I can. Just... ya know. order me around and such.
Enlist yourself as a trooper for H.S. Teoh's squad of the New AA implementation :) Basically I'd wish to help him (and others) finalize it but have no time to spent. -- Dmitry Olshansky
Mar 29 2013
parent 1100110 <0b1100110 gmail.com> writes:
On 03/29/2013 02:43 AM, Dmitry Olshansky wrote:
 29-Mar-2013 00:54, 1100110 пишет:
 On 03/28/2013 03:05 PM, Dmitry Olshansky wrote:
 The built-in ones are a minefield for anything more complex then a
 dictionary of string->int :)
Please, last I checked, they were still a minefield for that... Random crashes, basic issues with the type system... I just stopped using them... But that's not very helpful. So if someone wants to tell me what I can do to help fix it, I'll do whatever I can. Just... ya know. order me around and such.
Enlist yourself as a trooper for H.S. Teoh's squad of the New AA implementation :) Basically I'd wish to help him (and others) finalize it but have no time to spent.
I'll look into it. Thanks
Mar 30 2013
prev sibling next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Mar 28, 2013 at 08:45:42PM +0100, Rob T wrote:
 I recall some discussion about AA's being buggy and fixing the bugs
 is difficult, and that there may be future changes to how AA's
 operate, for example perhaps moving it to a library solution.
 
 So I am wondering if I should simply avoid using the built-in AA's
 entirely at this time, and instead create my own custom solution, or
 maybe there is a stable AA alternative already available?
[...] You can also look at my attempted AA replacement: https://github.com/quickfur/New-AA-implementation It's basically a rewrite of the built-in AA's using a template. Some corner cases aren't handled yet, but the basic functionality is all there (plus, it fixes a lot of existing bugs with the current built-in AA's). T -- The only difference between male factor and malefactor is just a little emptiness inside.
Mar 28 2013
prev sibling next sibling parent "Rob T" <alanb ucora.com> writes:
Thanks for the comments.

It seems that my best option is to avoid the built in AA's for 
now. I'll take a look at the suggested alternative solutions.

One thing I'm looking for is enforced explicit additions of new 
key value pairs rather than the magical method used by the built 
in AA's, it's to easy to make mistakes with it.

--rt
Mar 28 2013
prev sibling parent "Dicebot" <m.strashun gmail.com> writes:
Issues as described by H.S. Teoh are still available in wiki : 
http://wiki.dlang.org/AA_Implementation_Issues
tl; dr: current implementation is so hacky, that proper 
transition is no small feat.

I wanted to continue this project initially, but then decided 
there are other more important things to do.
Mar 29 2013