How does laziness and UFCS interact?

2015-03-09 Thread Logan Capaldo via Digitalmars-d-learn
I just became aware of http://dlang.org/phobos/std_exception.html#.ifThrown . It's neat, but it seems non-obvious to me how lazy + UFCS should work in general. consider void lazily(T)(lazy T expression) { expression(); } It's clear when saying lazily(a.b().c()); that the whole of "a.b()

Re: How does laziness and UFCS interact?

2015-03-09 Thread Ali Çehreli via Digitalmars-d-learn
On 03/09/2015 03:03 PM, Logan Capaldo wrote: I just became aware of http://dlang.org/phobos/std_exception.html#.ifThrown . It's neat, but it seems non-obvious to me how lazy + UFCS should work in general. consider void lazily(T)(lazy T expression) { expression(); } It's clear when saying

Re: How does laziness and UFCS interact?

2015-03-10 Thread Logan Capaldo via Digitalmars-d-learn
On Monday, 9 March 2015 at 22:15:43 UTC, Ali Çehreli wrote: You are right. I had the same observation at minute 11:27 below, where I warn against UFCS with assumeWontThrow: http://www.youtube.com/watch?feature=player_detailpage&v=oF8K4-bieaw#t=687 Ali Sorry, which is right? I know ifThrown

Re: How does laziness and UFCS interact?

2015-03-10 Thread John Colvin via Digitalmars-d-learn
On Tuesday, 10 March 2015 at 14:41:00 UTC, Logan Capaldo wrote: On Monday, 9 March 2015 at 22:15:43 UTC, Ali Çehreli wrote: You are right. I had the same observation at minute 11:27 below, where I warn against UFCS with assumeWontThrow: http://www.youtube.com/watch?feature=player_detailpage&v

Re: How does laziness and UFCS interact?

2015-03-10 Thread via Digitalmars-d-learn
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 "n

Re: How does laziness and UFCS interact?

2015-03-12 Thread Ali Çehreli via Digitalmars-d-learn
On 03/10/2015 08:00 AM, John Colvin wrote: > On Tuesday, 10 March 2015 at 14:41:00 UTC, Logan Capaldo wrote: >> On Monday, 9 March 2015 at 22:15:43 UTC, Ali Çehreli wrote: >>> You are right. I had the same observation at minute 11:27 below, >>> where I warn against UFCS with assumeWontThrow: >>>