iterate over enum name:value pairs

bearophile bearophileHUGS at lycos.com
Sun Dec 8 16:43:39 PST 2013


>>    static Suit[5] suits =  [
>> 		{"spades",1,6,"spd"},
>> 		{"hearts",4,10,"hrt"},
>> 		{"hearts2",4,10,"hrt2"},
>> 		{"diamonds",10,16,"dmd"},
>> 		{"clubs",11,17,"clb"}

Also, in D it's better to put a space after every comma, to 
increase readability a little:

     static immutable Suit[5] suits =  [
  		{"spades", 1, 6, "spd"},

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list