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

Reply via email to