More on Rust

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri Feb 11 14:11:12 PST 2011


On 2/11/11, Christopher Nicholson-Sauls <ibisbasenji at gmail.com> wrote:
>
> Even better:
>
> switch( funcall() ) {
>     case "foo", "bar", "foobar", "barfoo": {
>         // complex code
>         break;
>     }
>
>     case "blue", "green": {
>         // complex code
>         break;
>     }
>
>     default:
>         // do nothing -- i like to comment defaults
> }
>
> Also often forgotten, that 'case' clauses take an argument list, not
> just an expression.  And yeah, in this case at least... it still fits in
> 80 columns.  (I prefer 90 myself, but it's moot.)
>
> -- Chris N-S
>

Damn I didn't know that! Thanks.


More information about the Digitalmars-d mailing list