On Wed, Nov 07, 2012 at 05:08:43AM +0100, bearophile wrote: [...] > So the associative array is updated before taking its length. I > suggest to try to fix this AA behavour before too much D2 code relies > on this. I'd like to avoid this to become a permanent wart of D2. > > My bug report is from February 2010, it's in the most important 20 > bug reports of mine. In my opinion it's wrong to add new features to > D before similar bugs are fixed: > > http://d.puremagic.com/issues/show_bug.cgi?id=3825 [...]
I'd love to fix AA's once for all. The problem is that right now the AA code is scattered all over the compiler, and even within druntime it's a schizophrenic mosaic of half-duplicated code, partly in aaA.d and partly in object_.d. It's a major undertaking even just to refactor this code in a sane way. Would you like to help in this effort? ;-) I tried to do it myself some time ago, and I did get as far as a struct that works pretty much like the built-in AA's with quite a good number of current issues fixed, but it got stuck with handling const, pure, IFTI bugs, and a number of related issues. Frankly, at this point I believe that it's going to take more than one person to do it. We need a team of about 2-3 to tackle different aspects of it so that we can clean up the whole thing properly. My code is already up on github, but so far it seems that no one has been interested to contribute yet. I do agree that cleaning up AA's should be quite an important item in D2. There are quite a lot of IMO serious problems with the current implementation. But it ain't gonna happen unless more people help. T -- Meat: euphemism for dead animal. -- Flora
