digitalmars.D - [Associative arrays (AA)] static initializers
- Andrew Fedoniouk (13/13) Mar 10 2005 Are they feasible in foreseeable future?
- MicroWizard (4/17) Mar 10 2005 Would be very useful for any quick and (not too) dirty hacks/utilities
-
Stewart Gordon
(8/16)
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 )<snip> Been brought up before: http://www.digitalmars.com/drn-bin/wwwnews?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