Tuple DIP

Basile B. b2.temp at gmx.com
Sat Jan 13 02:15:37 UTC 2018


On Saturday, 13 January 2018 at 02:08:03 UTC, jmh530 wrote:
> On Friday, 12 January 2018 at 22:44:48 UTC, Timon Gehr wrote:
>> As promised [1], I have started setting up a DIP to improve 
>> tuple ergonomics in D:
>> [snip]
>
> I'm glad you're working on this.
>
> Proposal 1 is a little terse in explaining what you mean by 
> unpacking AliasSeqs. You might explain it in a little more 
> detail.
>
> Also, Proposal 1 starts with this example
> auto (a, b) = tuple(1, "2");
> (int a, string b) = tuple(1, "2");
> but it also looks natural to be able to write
> (int, string) (a, b) = tuple(1, "2");

Really ?
After the type should be the declarator. In this example there's 
no declarator but if you add it then it becomes very strange:

(int, string) ab (a, b) = tuple(1, "2");




More information about the Digitalmars-d mailing list