Wrong lowering for a[b][c]++

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Mar 22 09:44:53 PDT 2012


On Thu, Mar 22, 2012 at 03:48:24PM +0100, Andrej Mitrovic wrote:
> On 3/22/12, H. S. Teoh <hsteoh at quickfur.ath.cx> wrote:
> > This is because in aaA.d _aaGetX creates a new entry if one isn't found,
> > but because it has no direct access to value types (only has typeinfo),
> > it doesn't know what value .init has. It sets the value to binary zero
> > by default.
> 
> Damn, hashes really are a terrible hack. I'm really looking forward to
> your new implementation.

You can check out the current code here:

	https://github.com/quickfur/New-AA-implementation

You can just import newAA. Obviously it's not integrated with
druntime/dmd yet, so it doesn't have the nice V[K] or literal syntax.
But you can use it as AssociativeArray!(K,V). There's also a fromLiteral
static method that you can use to simulate literals (I'm considering
making it a module function instead of a static method, though).

It should work like the current implementation, for the most part,
except for some outstanding issues I'm working on.

Actually, it would be nice if people gave me some feedback on how well
the current implementation works. :-) I may not be aware of all the
issues that need fixing.


T

-- 
Life is complex. It consists of real and imaginary parts. -- YHL


More information about the Digitalmars-d mailing list