Tuples a first class feature, manu's new unary operator and named arguments

Timon Gehr timon.gehr at gmx.ch
Fri May 8 23:21:43 UTC 2020


On 09.05.20 00:29, 12345swordy wrote:
> On Friday, 8 May 2020 at 22:20:03 UTC, Timon Gehr wrote:
>> On 08.05.20 22:38, 12345swordy wrote:
>>> [...]
>>
>> No, too ugly. Anyway, there should not be a difference in features for 
>> tuples and multiple function arguments. In mathematics, those are the 
>> same thing. (I.e. each function has one parameter, which may be a 
>> tuple.) Ideally, built-in tuples and multiple function arguments 
>> should interact in a way that is consistent with this principle.
>>
>>> [...]
>>
>> That's true even now, so this is not a strong argument. The problem is 
>> that existing names are inconsistent because naming is hard and the 
>> authors were not aware that function names are part of the public API. 
>> Attributing this situation to named arguments is simply a mistake.
>>
>>> [...]
>>
>> I don't see why you would start a new DIP instead of forking mine, but 
>> in any case, syntax for a named argument tuple should be (x: 0, z: 0), 
>> not (int x = 0, int z = 0).
> 
> I do not see anyone done that before,

Actually, Andrei and Razvan forked my draft for the `__mutable` DIP [1] 
but I asked to be removed from the list of authors as they changed it to 
the point where it was no longer the same feature and I no longer 
supported it.

> so I assume that was consider it to be a bad thing.

On the contrary. Forking is a very productive form of collaboration. 
It's licensed under CC0 where copyright belongs to the D language 
foundation. The only reason I wrote it is so we may get the feature. 
It's nice that you are able to invest time towards getting some 
first-class tuple support into the language.

> Looks like you give me permission then to fork it 
> then. I will give it some needed polish.
> 
> -Alex

Great. :)


[1] https://github.com/RazvanN7/DIPs/blob/Mutable_Dip/DIPs/DIP1xxx-rn.md


More information about the Digitalmars-d mailing list