What name does this syntax have

In nim, you can do the following:

let num = 5.add(3)

which will be the same as

let num = add(5,3)

So basically you accept the expression before the dot as the first argument to the function. I am sure that other languages ​​have this feature, but no one remembered.

What I want to know is the name that has this syntax

+4
source share
3 answers

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

+7
source

The manual says that this is the syntax of a method call . He also mentions dot operators .

+5
source

TL; DR - Unified [Function] Call Syntax , .

, - :

0

Source: https://habr.com/ru/post/1568656/


All Articles