DIP19: Remove comma operator from D and provision better syntactic support for tuples

Timon Gehr timon.gehr at gmx.ch
Sun Sep 23 16:28:32 PDT 2012


On 09/24/2012 01:08 AM, deadalnix wrote:
> Le 24/09/2012 00:48, Andrei Alexandrescu a écrit :
>> This notion a lot of trouble with it; I think it's safe to abandon it
>> entirely.
>>
>> Once a one-element tuple becomes equivalent to the actual item, there's
>> an explosion of trouble and special cases in the language and in code
>> that uses it. For example, divide and conquer code that manipulates
>> tuples and takes t[0 .. $/2] and t[$/2+1 .. $] would suddenly get to
>> cases in which the slices are no longer tuples, and so on. And that's
>> only the beginning.
>>
>
> This is a very weak point. In most cases, divide an conquer with tuple
> don't even make sense.
>
>> Also, having no integrated notion of a zero-element tuple would again
>> mess with the algebra as much as the absence of 0 would hurt numbers.
>> It's just troublesome.
>>
>> I appreciate the attraction of this idea, but again I think it's safe to
>> just not even discuss it.
>>
>
> I'm not sure I want to answer that, so I wont.

I agree with Andrei. Single element tuples need to support the same
operations as tuples of other arities do.


More information about the Digitalmars-d mailing list