News for hackers. Stuff that matters.
Re:Destroy All Ifs – A Perspective from Functional Programming by vorg on Sunday July 17, 2016 @05:22PM (#12111898)
Use a function that prints then returns its parameter:

  list(1, 2, 3, 4).reduce{print(_) + _} == 10
Use it if you or your language hasn't defined such a function:

  list(1, 2, 3, 4).reduce{it:= _; println(it); it + _} == 10
In fact, any name for it will do.

There are no comments on this comment yet.