switch()

Walter Bright newshound2 at digitalmars.com
Mon Feb 17 11:51:09 PST 2014


On 2/17/2014 5:49 AM, Manu wrote:
> Refer to my other reply wrt the 'rubble' concept.

Sure :-)


> I think a quality implementation would be fairly game changing. A properly
> scoped and fully featured switch/select/match statement would result in some
> radical simplifications of code all over the place.

I have a real hard time seeing the proposed changes as radical or game changing.


> If switch (or something like it) were massaged to be as nice to use as foreach
> is, I think you'll find it will be used all over the place.

foreach() is quite a large improvement, because by abstracting away the 
mechanics of iteration, code need no longer be aware of just what abstract type 
is being looped over. Furthermore, it eliminates several common sources of 
coding bugs.

I'm not seeing this with changes in switch.



More information about the Digitalmars-d mailing list