www.digitalmars.com         C & C++   DMDScript  

D - Select statement?

reply "Lev Elbert" <elbertlev comcast.net> writes:
I have a suggestion: let's include in D a select statement with non-static
conditions:

seclect ()
{
case a < b:
    ....
    break;
case sin(k) < cos(b):
    ....
    break;
case str == "12345":
    ....
    break;
case default:
    ....
    break;
}

which is equivalent to if - else if - else block, but in some cases more
compact and understandable.

I would not mind if instead of select another keyword would be used :)
Regards.
May 08 2004
parent "Matthew" <matthew.hat stlsoft.dot.org> writes:
You're posting on the wrong group. Try news://news.digitalmars.com/digitalmars.D

"Lev Elbert" <elbertlev comcast.net> wrote in message
news:c7jp6o$2m1i$1 digitaldaemon.com...
 I have a suggestion: let's include in D a select statement with non-static
 conditions:

 seclect ()
 {
 case a < b:
     ....
     break;
 case sin(k) < cos(b):
     ....
     break;
 case str == "12345":
     ....
     break;
 case default:
     ....
     break;
 }

 which is equivalent to if - else if - else block, but in some cases more
 compact and understandable.

 I would not mind if instead of select another keyword would be used :)
 Regards.
May 08 2004