Worst ideas/features in programming languages?
Timon Gehr
timon.gehr at gmx.ch
Wed Jan 5 07:35:12 UTC 2022
On 05.01.22 08:28, Timon Gehr wrote:
>>
>>> To be very clear, I want this:
>>>
>>> [(1,2),(3,4)].map!((a,b)=>a+b).each!writeln;
>>>
>>> An this is generally what people mean when they talk about "tuples".
>>
>> I understand. It looks like a worthy goal.
>
> How about something like opArgs, dealing specifically with this case?
> (i.e., a function call `foo(x)` with a single argument is immediately
> rewritten to `foo(x.opArgs)` if `x` has a member `opArgs`, and this
> rewrite is applied exactly once.)
(This would apply symmetrically at the call site, so that if we define a
function `foo(T x)`, where T has an opArgs, it's `foo(typeof(T.opArgs)
x)` instead.)
More information about the Digitalmars-d
mailing list