__FILE__

Steven Schveighoffer schveiguy at gmail.com
Thu Aug 5 02:46:24 UTC 2021


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


More information about the Digitalmars-d-learn mailing list