Improvement to switch-case statement
Stewart Gordon
smjg_1998 at yahoo.com
Fri Jan 2 05:15:11 PST 2009
Yigal Chripun wrote:
<snip>
> IMO, either the switch statement should remain the low level
> (effiecient) construct as in C, or replaced by a general mechanism of
> pattern matching. your solution is kinda between the two above options
> and I don't see the point of it.
What would a "general mechanism of pattern matching" involve, and how
would it replace switch? Would it replace if as well?
> I'd personally prefer pattern matching to be added to D and the switch
> to be deprecated and eventually removed from the language.
I'd personally prefer my proposal from years ago to be taken seriously:
http://www.digitalmars.com/d/archives/22722.html
ISTM silly to improve switch but at the same time keep it restricted to
the same old arcane syntax.
Stewart.
More information about the Digitalmars-d
mailing list