digitalmars.D - [Associative arrays (AA)] static initializers
- "Andrew Fedoniouk" <news terrainformatica.com> Mar 10 2005
- MicroWizard <MicroWizard_member pathlink.com> Mar 10 2005
- Stewart Gordon <smjg_1998 yahoo.com> Mar 11 2005
Are they feasible in foreseeable future?
int[char[]] m = { "one":1, "two":2 };
char[][int] m = { 1:"one", 2: "two" };
It could be extremely nice to have them...
( keeeping also in mind Matthew's enum2str
implementation )
I think that they could be implemented
internally as sorted (at compile time) key/value pairs
with binary search lookup.
As far as I can see they fit
in grammar without any changes.
Andrew Fedoniouk.
http://terrainformatica.com
Mar 10 2005
Would be very useful for any quick and (not too) dirty hacks/utilities what I usually have to write. I impatiently look forward for all the static array initialization solutions. Tamas NagyAre they feasible in foreseeable future? int[char[]] m = { "one":1, "two":2 }; char[][int] m = { 1:"one", 2: "two" }; It could be extremely nice to have them... ( keeeping also in mind Matthew's enum2str implementation ) I think that they could be implemented internally as sorted (at compile time) key/value pairs with binary search lookup. As far as I can see they fit in grammar without any changes. Andrew Fedoniouk. http://terrainformatica.com
Mar 10 2005
Andrew Fedoniouk wrote:Are they feasible in foreseeable future? int[char[]] m = { "one":1, "two":2 }; char[][int] m = { 1:"one", 2: "two" }; It could be extremely nice to have them... ( keeeping also in mind Matthew's enum2str implementation )
Been brought up before: D/26695 Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Mar 11 2005









MicroWizard <MicroWizard_member pathlink.com> 