Should we deprecate comma?

Marc Schütz" <schuetzm at gmx.net> Marc Schütz" <schuetzm at gmx.net>
Mon Mar 24 05:20:10 PDT 2014


On Monday, 24 March 2014 at 12:10:40 UTC, Marc Schütz wrote:
> On Monday, 24 March 2014 at 01:28:02 UTC, Kenji Hara wrote:
>> I'm partially against to it.
>>
>> 1. I think removing comma operator does not have useful effect 
>> for tuple
>> syntax discussion. For example:
>>
>>   1a. If you want to use parenthesis syntax (...) for tuple, 
>> we should
>> resolve one-element tuple ambiguity first.
>>         (exp)   // one-element tuple, or just an expression ?
>>      And,  removing comma operator does not resolve this issue.
>
> I believe this is a non-issue. From a language-users POV, there 
> should be no difference between a one-element tuple and an 
> expression, thus there's no need to distinguish the two. (The 
> actual implementation in the compiler may of course treat them 
> differently.)

Or, if you really want to distinguish them, this would work:

(1,2)    two-element tuple
(1,)     one-element tuple
(1)      simple expression
(,)      empty tuple


More information about the Digitalmars-d mailing list