Replacing AA's in druntime

H. S. Teoh hsteoh at quickfur.ath.cx
Tue Mar 13 20:49:33 PDT 2012


On Wed, Mar 14, 2012 at 12:37:08PM +1100, Daniel Murphy wrote:
> Welcome to Hell. =D

Ahhhahahaha... sounds like I leapt into the deep end of the pool without
knowing it. :-P


> Some of the things you can do with AAs are recognized by the compiler
> during semantic and turned into druntime calls, sometimes the
> constructs survive all the way to the glue layer (e2ir) and are turned
> into druntime calls there and sometimes the type of an expressions is
> magically rewritten to AssociativeArray and the methods are looked up
> normally.  (this one caused problems with literals)
> 
> The type needs to stay as V[K] _not_ AssociativeArray, so that error
> messages work properly.  Something needs to be done about literals
> too...  Don't forget template arg deduction!
> 
> There's a function AAGetSym (or something like that) that can be
> searched for to find where dmd emits druntime calls, but there might
> be other places it generates them.
[...]

Alright. So now I have to dig into dmd internals to do what I want.
Maybe I should complete the template implementation first before
tackling this stuff. Sounds nasty. :-P  (But then again, I *did* have to
deal with over-engineered C++ in the past, which at one point required
making an IPC call via 6 levels of abstraction, one of which involved
fork(), fwrite() and fread(). I doubt dmd attains to that level of
evil.)


T

-- 
Жил-был король когда-то, при нём блоха жила.


More information about the Digitalmars-d mailing list