Should we deprecate comma?

Etienne Cimon etcimon at gmail.com
Sun Mar 23 21:55:43 PDT 2014


On 2014-03-24 00:41, Andrei Alexandrescu wrote:
> On 3/23/14, 9:29 PM, Etienne Cimon wrote:
>> On 2014-03-24 00:04, Andrei Alexandrescu wrote:
>>> On 3/23/14, 8:22 PM, Etienne Cimon wrote:
>>>> How about allowing it only inside parenthesis?
>>>
>>> That works but breaks more valid code. -- Andrei
>>>
>>
>> If the comma expression operator is outlawed on the global scope,
>> variadic template parameters could be used with commas outside the
>> parantheses which allows such syntax:
>>
>> if(pMgr->ShouldRecordEvent(eSE_Weapon), pOwnerRaw) // ERROR
>> return pMgr->RecordEvent(eSE_Weapon), pOwnerRaw; // ERROR
>> if(e!pMgr->ShouldRecordEvent(eSE_Weapon), pOwnerRaw) // OK
>> return e!pMgr->RecordEvent(eSE_Weapon), pOwnerRaw; // OK
>>
>> Would it make sense to reserve the global e identifier for expressions?
>
> With that the approach would be veering off the road. -- Andrei
>

Well, I'll vote for the compromise, there shouldn't be issues with 
keeping statements in void contexts such as
int i, j, k;
i++, j++, k--;
etc.

And then I guess I'll change that part of my coding style, everyone 
seems to hate it so much ..


More information about the Digitalmars-d mailing list