comma operator causes hard to spot bugs

Timon Gehr timon.gehr at gmx.ch
Mon Apr 23 01:08:52 PDT 2012


On 04/23/2012 01:56 AM, deadalnix wrote:
> Le 21/04/2012 18:54, bearophile a écrit :
>> Jonathan M Davis:
>>
>>> There have been discussions about the comma operator before. I don't
>>> expect that it's going anywhere,
>>
>> Maybe there are intermediate solutions between keeping wild commas in D
>> and disallowing them fully. I think most of my bugs caused by commas are
>> similar to the one shown by the OP. This means this is not a common
>> source of bugs:
>>
>> foo(), bar();
>>
>
> This is completely redundant with foo(); bar();

Not completely, you also need  {  }

if(qux()) foo(), bar();

>
> I see no benefit from being able to do this.


More information about the Digitalmars-d mailing list