Is it bad for object.di to depend on core.exception?

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Mar 3 22:03:07 PST 2012


On Sun, Mar 04, 2012 at 03:24:47PM +1100, Daniel Murphy wrote:
> "Andrei Alexandrescu" <SeeWebsiteForEmail at erdani.org> wrote in message 
> news:jiuol3$rqb$1 at digitalmars.com...
[...]
> > I think we must migrate the arrays into the runtime.
> >
> > Andrei
> 
> I know.  It was before my time, but I assume you were the one who
> pushed for this in the first place?
> 
> The one advantage I can see to having them in druntime gives is that
> it means they can be fully templated, and therefore do comparisons etc
> without going through typeinfo.  This is it right? 
[...]

Not just comparisons, but size of values, etc., all need typeinfo
currently. Pretty much all the code in aaA.d needs to dig under the hood
and do lots of black magic like pointer arithmetic based on typeinfo
stuff in order to do stuff. Perhaps _aaLen might be the only exception.
While it's cool that D lets you do this when needed, it's also a sign
that some cleanup might be in order. :-)

How feasible is it to migrate AA's into object_.d, say, and have the
stuff in aaA.d simply wrap around AssociativeArray? I suppose this can't
really happen without some major changes in the compiler, since I don't
know how to instantiate AssociativeArray given only the typeinfo's (not
the actual types) of the key/value.


T

-- 
It won't be covered in the book. The source code has to be useful for something, after all. -- Larry Wall


More information about the Digitalmars-d mailing list