From the D Blog: Crafting Self-Evident Code in D

matheus matheus at gmail.com
Tue Oct 3 15:10:11 UTC 2023


On Tuesday, 3 October 2023 at 13:33:29 UTC, Dom DiSc wrote:
> On Tuesday, 3 October 2023 at 10:39:19 UTC, matheus wrote:
>> I the first example "e" is receiving two arguments. While in 
>> the latter "d" is being receiving whatever "c" returns and "3".
>
> That's the point. In UFCS it is immediately obvious which 
> function receives the 3, while with all the parenthesis it 
> takes some time and concentration to find out, and getting it 
> wrong is quiet easy.

I understand the advantages of the UFCS, I was just pointing out 
that the example given in that post are NOT equivalent, if it was 
deliberated or not I don't know, but I think it was just a small 
mistake, otherwise the author woundn't say they are equivalent.

Matheus.


More information about the Digitalmars-d-announce mailing list