Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What name does this syntax have

Tags:

nim-lang

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

like image 487
Dirk Avatar asked Dec 12 '22 02:12

Dirk


1 Answers

In D lang this syntax is called Uniform Function Call Syntax (UFCS).

like image 130
Alex Yakovlev Avatar answered Feb 16 '23 02:02

Alex Yakovlev