Associative Array Initializers

Joseph Bell josephabell at tx.rr.com
Mon Jan 22 20:39:32 PST 2007


Certainly, anything is possible, but honestly, its a headache.  Is there 
a specific forum or tracking mechanism to monitor or provide input on 
language feature requests?  From the previous posts to this thread it 
seems this one would be a candidate for a subsequent revision.

Joe

Bill Baxter wrote:
> Serg Kovrov wrote:
>> Frits van Bommel wrote:
>>> No, that's one of the big missing things.
>>
>> Exactly!
>>
> 
> Seems like with tuples now it might be possible to make a function that 
> would do the trick:
> 
> int[char[]] months = AA("Jan", 1, "Feb", 2, "Mar", 3);
> 
> This could be another interesting challenge akin to Andrei's max() 
> challenge.  Write a function that constructs an AA from it's arguments 
> using the "best" types.
> 
> For that matter it would be interesting to see a template which 
> constructs an array using the best type to hold the arguments (as 
> opposed to just the type of the first argument).
> 
> --bb



More information about the Digitalmars-d mailing list