assoc array initialization like in php

dennis luehring dennis_member at pathlink.com
Mon Feb 20 02:35:54 PST 2006


in php you can init an assoc array
(for example with string-key and numeric value)
with

$test = array
(
'test' => 1,
'bla' => 2,
'blub' => 3
);

can we have something equal to this in d?

int test[char[]] = 
{
"test" => 1,
"bla" => 2,
"blub" => 3
}

or an enum example

enum ekey { TEST, BLA, BLUB };
int test[ekey] =
{
TEST => 1,
BLA => 2,
BLUB => 3
}

or is this an working feature in d (i cant find such examples in the docs)

ciao dennis





More information about the Digitalmars-d mailing list