Deprecate {} without () for function pointers and delegates
Meta
jared771 at gmail.com
Mon Jun 15 08:35:14 UTC 2026
On Monday, 15 June 2026 at 07:46:41 UTC, Dmitry Olshansky wrote:
> On Friday, 12 June 2026 at 21:07:49 UTC, ABrightLight wrote:
>>
>> Anyway, I'd rather not have to juggle these questions in my
>> mind, and a simple solution would be to deprecate function
>> literals that omit the parentheses for the parameter list.
>> Having to type an extra 2 characters is well worth not having
>> to think about the edge cases.
>
> For me in Photon that would be the difference between
> go({ block of code });
> and
> go((){ block of code });
>
> Gnarly syntax reminding of c++ lambdas. While currenly it looks
> almost as simple as Go lang.
>
>> Thank you
With UFCS, that can also be written as:
go = { block of code };
go = (){ block of code };
Gross.
More information about the Digitalmars-d
mailing list