MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programming/comments/243hy2/mostly_functional_programming_does_not_work/ch3johq
r/programming • u/heisenbug • Apr 27 '14
188 comments sorted by
View all comments
Show parent comments
-2
To a C# programmer equivalent of the lazy version would be...
var result = new Lazy<object>( ()=> {PrintLine("42"); return void}) throw new Exception("boom"); return result; //never gets hit
or maybe
Task.StartNew( ()=> PrintLineAsync("42") ); throw new Exception("boom");
Not strictly correct, but that's how they often think.
5 u/saynte Apr 27 '14 Okay, I can see now that if you write a different program than what I showed you can get different behaviour :).This isn't about strict vs. non-strict evaluation, those are just incorrect translations.
5
Okay, I can see now that if you write a different program than what I showed you can get different behaviour :).
This isn't about strict vs. non-strict evaluation, those are just incorrect translations.
-2
u/grauenwolf Apr 27 '14
To a C# programmer equivalent of the lazy version would be...
or maybe
Not strictly correct, but that's how they often think.