News for hackers. Stuff that matters.
Re:SICP Goodness – Why you don't need looping constructs by setr on Friday June 29, 2018 @01:23PM (#17425962)
One situation I haven't found a good construct for yet is iterating over a list to do some work unrelated to the list ie

foreach(i in list){

if i == 0 { class.a() }

else { class.b() }

}

Re:SICP Goodness – Why you don't need looping constructs by goalieca on Friday June 29, 2018 @03:34PM (#17427131)
But foreach is a function.

The weird thing about your pattern is that class.a() and class.b() may have side effects and don’t seem to depend on i at all. If I were to optimize this loop or even make it parallel, then I’m certainly missing some information. Some information that could be captured by another expression.