January 12, 2024 General » Re: named arguments, string interpolation, please stop. | |||
|---|---|---|---|
| |||
...view
```d
int opApply(@called scope int delegate() dg)b{ ... }
```
As syntactic sugar for:
```d... | |||
January 12, 2024 General » Re: named arguments, string interpolation, please stop. | |||
|---|---|---|---|
| |||
...d
void opApply[functionAttribute a](scope int delegate()a dg)a{
....
}
```
Done. Here, everything in... | |||
January 12, 2024 General » Re: named arguments, string interpolation, please stop. | |||
|---|---|---|---|
| |||
...void delegate() @safe @nogc del) @safe @nogc {
del();
}
```
If we pass in ``@nogc`` delegate, it... | |||
January 11, 2024 Learn » Re: Generating custom toString for structs | |||
|---|---|---|---|
| |||
In retrospect, that delegate version is probably quite a bit better. | |||
January 11, 2024 General » Re: named arguments, string interpolation, please stop. | |||
|---|---|---|---|
| |||
...the tasks, refine the vision, and then delegate the tasks to the corresponding personnel`! Instead... | |||
January 11, 2024 Learn » Re: Generating custom toString for structs | |||
|---|---|---|---|
| |||
...toString(a);`. I don't use the delegate version personally, but if that's already... | |||
January 09, 2024 General » Re: We are forking D | |||
|---|---|---|---|
| |||
...the kernel. But he knows how to delegate -- he has not a small number of... | |||
January 07, 2024 Learn » Generating custom toString for structs | |||
|---|---|---|---|
| |||
...template StructToString(S)
{
void toString(scope void delegate(const(char)[]) sink,
FormatSpec!char fmt)
{
put... | |||
January 05, 2024 Learn » Re: Trying to understand map being a template | |||
|---|---|---|---|
| |||
...function pointer (or delegate). [...] The argument is taken to be a delegate to be bound... | |||
January 05, 2024 Learn » Trying to understand map being a template | |||
|---|---|---|---|
| |||
...main()
{
int r = uniform(0,100);
int delegate(int)[] funcs = [
x => x * 2,
x => x... | |||
Copyright © 1999-2021 by the D Language Foundation