DIP 1003 Formal Review

Timon Gehr via Digitalmars-d digitalmars-d at puremagic.com
Wed May 17 09:23:30 PDT 2017


On 17.05.2017 14:47, Patrick Schluter wrote:
>>
> I don't understand why this would be uglier than )( used in templates.
.
This is a different case. In C-like languages '(' is essentially a 
binary operator and the second set of parens applies to the result of 
the first set. f(a)(b) is curried function application. The function 
body does not apply to the contract in any way, they are two 
syntactically independent constituents of the function declaration.

(Clearly, function template declaration syntax would be better as "void 
foo!(A,B,C)(A a, B b, C c){ ... }", but fixing this is perhaps not an 
option now.)


More information about the Digitalmars-d mailing list