Named Arguments Status Update - Overloading by name
Lance Bachmeier
no at spam.net
Tue Apr 9 21:33:21 UTC 2024
On Tuesday, 9 April 2024 at 21:15:59 UTC, Uranuz wrote:
> I was thinking that assignment could be the reason, because
> assigment could have some return value.
Not just that, but also the way you can write function calls as
assignments, even when you wouldn't expect it. A very nice
feature when you have a use for it, but it also lets rebels write
stuff like this:
```
import std;
void main() {
writeln(f=4.7);
auto h=g(f=4.7);
writeln(h);
}
double f(double x) {
return 2.5*x;
}
double g(double x) {
return 2.5*x;
}
```
More information about the Digitalmars-d
mailing list