Tuple DIP

jmh530 john.michael.hall at gmail.com
Sat Jan 13 02:08:03 UTC 2018


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");
it looks from some of the other proposals that if they combine 
together then this would also work.

Proposal 3 could use an example with named tuples.

In proposal 6, how does
auto (a, _) = t;
expand for multiple? Would you be forced to do
auto (a, _, _, _, _, _) = t;
if the tuple has 6 entries?


More information about the Digitalmars-d mailing list