On 8/4/21 10:27 PM, Ali Çehreli wrote:
I wonder whether this feature is thanks to 'lazy' parameters, which are actually delegates.

No, the default parameters are used directly as if they were typed in at the call site (more or less, obviously the `__FILE__` example is weird).

So:

```d
writeln(foo());
```

is just like you did:

```d
writeln(foo(bar()));
```

There are no lazy parameters involved.

-Steve
  • __FILE__ workman via Digitalmars-d-learn
    • Re: __FILE__ Adam D Ruppe via Digitalmars-d-learn
      • Re: __FILE__ Stefan Koch via Digitalmars-d-learn
        • Re: __FILE__ Steven Schveighoffer via Digitalmars-d-learn
          • Re: __FILE__ Ali Çehreli via Digitalmars-d-learn
            • Re: __F... Steven Schveighoffer via Digitalmars-d-learn
    • Re: __FILE__ Mathias LANG via Digitalmars-d-learn

Reply via email to