Thanks.  That's looking pretty clean.

I had already tried the shorter enum names without using the with statement, and it failed to compile. I thought it might work since the struct definition already specifies the enum type for the two members.



    with (Suit) with (SuitShort)
    {
        static Suits[] suits = [
            {spades,    1,  6, spd},
            {hearts,    4, 10, hrt},
            {diamonds,  4, 10, dmd},
            {clubs,    10, 16, clb}
        ];

        foreach (immutable member;  suits)
        ...


Bye,
bearophile

Reply via email to