Tuple DIP

Mark smarksc at gmail.com
Sat Jan 13 22:38:12 UTC 2018


On Saturday, 13 January 2018 at 20:57:31 UTC, Timon Gehr wrote:
> On 13.01.2018 21:39, rjframe wrote:
>> Python and Pony use (). C++17 uses [].
>
> Any idea why C++17 went with [] ?
>
>> Perhaps D should use <>? [not a
>> serious question]
>> 
>> It was hard for me not to use angled brackets for templates 
>> when I started
>> with D, but now it's second nature. I think you're right, 
>> familiarity with
>> other languages is important, but it isn't everything.
>> ...
>
> I'd like to stress again that the proposed syntax is standard.
>
>> I'm not sure I like the idea of ever reading `foo((a, b), 
>> c);`, but like
>> templates, I'd get used to it.
>
> It would actually be unsatisfying to have two distinct ways to 
> group together a heterogeneous list (Tuples vs. function 
> argument lists.)
>
> foo((a, b), c);
>
> auto args = ((a, b), c);
> foo(args);

Yeah. Consider the implications for UFCS: you'd want both (a, 
b).foo(c) and ((a, b), c).foo() to work.


More information about the Digitalmars-d mailing list