In the language nim, one can do the following thing:
let num = 5.add(3)
which would be the same as
let num = add(5,3)
So, basically you take the expression before the dot as the first argument to the function. I'm sure other languages have this feature, but none directly came to mind.
What I want to know is what name this syntax has
In D lang this syntax is called Uniform Function Call Syntax (UFCS).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With