[dmd-internals] AssociativeArray in druntime should go before the next release

Don Clugston dclugston at googlemail.com
Sat Feb 4 00:02:37 PST 2012


On 4 February 2012 00:56, Steve Schveighoffer <schveiguy at yahoo.com> wrote:
> I'd much rather fix implicit storage of literals than incur both template bloat and have to deal with type deduction.  Besides the heap allocation issue, the rewrite that Don put forth already uses the compiler to type deduce the array types (and therefore the key and value types) without any excessive template bloat.  I'm assuming you meant something like:
>
> SomeRecursiveTemplateToDeduceKeyAndValue!(T) AALiteral(T...)(T vals) if (vals.length % 2 == 0 && SomeRecursiveTemplateToEnsureKeyAndValueExist!(T))
>
> What I was thinking is making something like:
>
> void foo(scope int[]) {}
> not allocate the argument to foo on the heap if it's a literal.
>
>
> -Steve

Note that there is no urgency on this. It's more important to get it
right, and that includes avoiding unnecessary heap allocations.
It should not be tied into the compiler, until it's behaving perfectly
except for syntax sugar.


More information about the dmd-internals mailing list