"with" still sucks + removing features + adding features
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon May 18 10:57:29 PDT 2009
Jarrett Billingsley wrote:
> On Mon, May 18, 2009 at 1:46 PM, Andrei Alexandrescu
> <SeeWebsiteForEmail at erdani.org> wrote:
>
>> Final switch works with enums and forces you to handle each and every value
>> of the enum. Regular switch gets ranged cases by the syntax case a: .. case
>> b: (I've always thought switch would be greatly helped by that).
>
> Kind of an odd syntax. Why not "case a .. b:"? Parsing issues?
It's consistency. Everywhere in the language a .. b implies b is
excluded. In a switch you want to include b. So I reflected that in the
syntax. In fact, I confess I'm more proud than I should be about that
little detail.
>> Static foreach might be making it too.
>
> That'd be a nice addition. Especially with __traits returning
> arrays/tuples, it'd be an alternative to CTFE (shudder) or template
> recursion.
Yah, can't wait.
Andrei
More information about the Digitalmars-d
mailing list