I dun a DIP, possibly the best DIP ever

Walter Bright newshound2 at digitalmars.com
Fri Apr 24 08:04:29 UTC 2020


On 4/24/2020 1:03 AM, Walter Bright wrote:
> On 4/24/2020 12:10 AM, Manu wrote:
>> Your idea all falls over anywhere it encounters variadic args, or potential 
>> for overloads though. Without an explicit expression, the only way forward is 
>> to preserve existing D semantics (or it's a radically breaking change), and 
>> that will severely narrow the applicability of this proposal.
>>
>> Consider this:
>>
>>    alias Tup = AliasSeq!(0, 2, 3);
>>    void fun(int);
>>    fun(Tup);  // scalar argument receives tuple, it can expand, so: fun(0), 
>> fun(1), fun(2)
> 
> Write it as:
> 
>      Tup.fun();

Incidentally, belay that. That will currently produce: fun(0, 2, 3);


More information about the Digitalmars-d mailing list