Worst ideas/features in programming languages?
Walter Bright
newshound2 at digitalmars.com
Tue Jan 4 07:52:00 UTC 2022
On 1/3/2022 10:37 PM, Timon Gehr wrote:
> If `foo(int, int)` is defined to be literally the same as `foo(int[2])`, there
> is no conversion. But anyway, I guess you'd also consider anything that would
> make this work an "implicit conversion"?
>
> double foo(int x,string y);
>
> writeln([(1,"2"),(1,"3"),(3,"4")].map!foo);
Currently, tuples can map right on to argument lists, there is no conversion.
This works because a tuple in D isn't really a type at all. It's just a
collection of expressions.
> If so, maybe one way to make _some_ progress on this is to have a DIP
> specifically for destructuring, without adding any new types?
I'm not sure what destructuring, but yes, not adding new types.
More information about the Digitalmars-d
mailing list