Should we deprecate comma?

Regan Heath regan at netmail.co.nz
Tue Mar 25 06:58:01 PDT 2014


On Tue, 25 Mar 2014 13:15:16 -0000, Timon Gehr <timon.gehr at gmx.ch> wrote:

> On 03/25/2014 02:08 PM, bearophile wrote:
>> Steve Teale:
>>
>>> The only place I have tended to use the comma operator is in ternary
>>> expressions
>>>
>>> bool universal;
>>>
>>> atq = whatever? 0: universal = true, 42;
>>
>> I classify that as quite tricky code, it's a negative example :-(
>>
>> Bye,
>> bearophile
>
> It's not tricky code. It is not even valid code. Operator precedence  
> from lowest to highest: , = ?.

Fixed:

atq = whatever ? 0 : (universal = true, 42);

Still a bad example.  Horrid code IMO.

R

-- 
Using Opera's revolutionary email client: http://www.opera.com/mail/


More information about the Digitalmars-d mailing list