Worst ideas/features in programming languages?
Steven Schveighoffer
schveiguy at gmail.com
Tue Oct 12 13:26:34 UTC 2021
On 10/12/21 8:42 AM, bauss wrote:
> On Tuesday, 12 October 2021 at 11:39:56 UTC, Steven Schveighoffer wrote:
>> On 10/12/21 2:14 AM, bauss wrote:
>>> On Tuesday, 12 October 2021 at 03:17:08 UTC, SealabJaster wrote:
>>>>
>>>> `abc => { return 123; }` should not be returning a function that
>>>> returns a function.
>>>>
>>>
>>> I agree with this so much, like why couldn't it have been made so you
>>> had to be explicit if you wanted to return a function? Like:
>>>
>>> `abc => &{ return 123; }`
>>
>> Just FYI, the `abc => {}` syntax is just recently deprecated.
>>
>> https://dlang.org/changelog/2.098.0.html#ambiguous-lambda
>>
>> -Steve
>
> Yeah, but I would rather that it was still allowed and that the
> semantics just changed.
>
> But obviously for good reason that isn't happening since it would break
> existing code.
What would you change it to?
`(abc) {return 123; }` already works. If you need to return a delegate,
then `abc => () { return 123; }` works. We don't need 10 names for
different kinds of snow.
-Steve
More information about the Digitalmars-d
mailing list