Suggestion: new switch statement
Kristian
kjkilpi at gmail.com
Thu Aug 24 13:39:51 PDT 2006
On Thu, 24 Aug 2006 21:12:31 +0300, Stewart Gordon <smjg_1998 at yahoo.com>
wrote:
> Jeff wrote:
>> How about allowing:
>> switch (val) {
>> case (1) {
>> doX();
>> } case (2, 3) {
>> doY();
>> } default {
>> doZ();
>> }
>> )
>> Or would this create some horrible syntactic ambiguities? Or, on the
>> other hand, it could just be too damn ugly. ;)
>
> Please see my proposal of the same thing from years ago:
>
> http://www.digitalmars.com/d/archives/22722.html
>
> Stewart.
>
Grhm, that was over 2.5 years ago... :(
I know there are much important things to get right and working, but I
sure do hope that Walter will someday (after 1.0?) improve the syntax for
some parts.
But yes, range definitions would be good to have indeed. It never occured
to me that cases could have else statements, that could be nice also. :)
More information about the Digitalmars-d
mailing list