The Comma Operator's Deprecation Can't Come Soon Enough

Meta via Digitalmars-d digitalmars-d at puremagic.com
Tue Jul 15 11:15:48 PDT 2014


On Tuesday, 15 July 2014 at 18:08:15 UTC, Martin Krejcirik wrote:
>>
>> Example?
>>
>
> For loop with multiple variables and various one liners of 
> questionable utility aside:
>
> import std.stdio;
>
> bool funk()
> {
>     static int count;
>     return ++count > 1 ? true : false;
> }
>
> void main()
> {
>     bool flag = false;
>     if (flag && funk)
>         writeln("a");
>     else if (flag=true, flag && funk)
>         writeln("b");
>     else if (flag && funk)
>         writeln("c");
> }

 From the previous discussion, everyone agreed that the loop 
variable usage would not be deprecated, even if the comma 
operator were deprecated elsewhere. That's pretty much the only 
place it's really useful. As for those one-liners, "questionable 
utility" is the keyword (and also "probably buggy").


More information about the Digitalmars-d mailing list