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

Walter Bright newshound2 at digitalmars.com
Sat May 9 03:03:45 UTC 2020


On 5/8/2020 3:20 PM, Timon Gehr wrote:
> On 08.05.20 22:38, 12345swordy wrote:
>> As I am working on the "Tuples first class feature" dip (will uploaded first 
>> draft soon), I noticed that if we would allow this in D:
>>
>> fun((int x = 10, int y = 1, int z = 2)...);
>>
>> Could this be used as a replacement for named arguments?
> 
> 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.

This is already the case in D:

   fun(AliasSeq!(10,1,2))

is the same as

   fun(10,1,2)


More information about the Digitalmars-d mailing list