How does laziness and UFCS interact?

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 10 16:36:32 PDT 2015


On Tuesday, 10 March 2015 at 17:42:37 UTC, Ali Çehreli wrote:
> You are right again. :) However, putting the lazy-taking 
> function "outside" the whole expression makes it visible right 
> away, making easy for me to realize that the execution order 
> may be different from common chains.

"lazy" aka "named parameters" semantically works just like macros 
using textual substitution. Just imagine that it is inlined in 
situ and it becomes clear what is happening.

I believe it was the common parameter transfer mode in Algol, but 
programmers found it terribly confusing, so just about all 
languages that followed have avoided it. So if anyone gets 
confused, then find some comfort in knowing that people found it 
confusing 50 years ago too. :^)


More information about the Digitalmars-d-learn mailing list