Should we deprecate comma?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Mar 23 21:41:40 PDT 2014


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



More information about the Digitalmars-d mailing list