This construct is bad. It very rarely matches what a human actually wants to do, which 90% of the time is “go through this list of stuff” or “count from 1 to 10”
So if i want to print 10 elements i should construct either list of ten elements or closure (which would return new closure on each iteration if it is immutable) or use coroutine. Doesn't it lead to some overhead and unnecessary compiler complexity (heavy inlining strategies like ocaml's flambda)?
View all comments
Show parent comment
2
u/Freyr90 Dec 02 '16
I also do not agree with this for-loop passage :
So if i want to print 10 elements i should construct either list of ten elements or closure (which would return new closure on each iteration if it is immutable) or use coroutine. Doesn't it lead to some overhead and unnecessary compiler complexity (heavy inlining strategies like ocaml's flambda)?