What is :-) ?

Antonio antoniocabreraperez at gmail.com
Tue Nov 21 16:36:13 UTC 2023


On Monday, 20 November 2023 at 16:47:13 UTC, Paul Backus wrote:

>
> You can put the `delegate` keyword in front of the function 
> literal:
>
> ```d
> auto createCounter = delegate (int nextValue) => () => 
> nextValue++;
> ```
>
> This syntax is documented in the spec's section on [Function 
> Literals][2] (look at the grammar box and the examples).
>
> [2]: https://dlang.org/spec/expression.html#function_literals

Thaks Paul


More information about the Digitalmars-d-learn mailing list