Is there ANY chance we can fix the bitwise operator precedence
bearophile
bearophileHUGS at lycos.com
Mon Jun 21 11:09:48 PDT 2010
KennyTM~:
> That is just C#'s switch syntax.
Some of the C# designers are people with a long experience in implementing (Pascal-like) programming languages. Convergent evolution is a way to confirm my idea was good, then :-)
>And I don't see how the current switch syntax is "hairy".<
Even if you aren't able to see it, it doesn't change the fact that D switch syntax is made by several enhancements (or even fixes, like the one currently discussed, and time ago in bugzilla I have asked for another fix to the switch syntax) over the C switch syntax that is quite unclean and unsafe to start with (see Duff's device for an example of how unclean it is, or the recently introduced "static switch" of D that patches a common bug source).
After about three years of using D I am able to forget that "goto case;" is a valid syntax. In another answer Jonathan M Davis says something similar:
>I forgot about that one. *Sigh* D has so many cool little features that sometimes it feels like I'm forgetting at least half of them. Oh well. It's silly to complain that D has too much cool stuff.<
When normal people forget or ignore parts of a basic language construct it means the language is very complex.
The recently introduced ranged case syntax can be handy, but it's not a clean thing.
So D switches are quite hairy. Somewhere we'll have to write a short list of the differences between D and C switches.
Bye,
bearophile
More information about the Digitalmars-d
mailing list