|
|
|
|
|
by WalterBright
1454 days ago
|
|
The neato thing about obj.foo() goes even further. Ever seen code like: a(b(c(d(e),3))
? Not very readable. UFCS (Universal Function Call Syntax) enables it to be written as: e.d.c(3).b.a();
Reading it flows naturally left-to-right. |
|
For those who are thinking UFCS is a trivial detail, consider that the shell and some other languages have pipe operators (|>) to make the code flow intuitively the same way as the data.
In my opinion, in a C-like language, managing to squeeze so much functionality out of the '.' operator without any downsides is the mark of a well thought out, elegant language.
Thank you for creating D.