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

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Sep 23 18:14:37 PDT 2012


On 9/23/12 7:08 PM, 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.

The example came from min() applied to built-in "T..." tuples. I've 
implemented it a few times, and I recall at some point there was a 
compiler bug related to zero-length tuples. It was rather awkward to 
address. But there are many other cases. In my opinion, introducing a 
change of phase at length=1 is just causing trouble.

Andrei




More information about the Digitalmars-d mailing list