Lisp lamda: When you need to use the same variable twice
(written by Lawrence Krubner, however indented passages are often quotes)
This says well at what point people switch to lamda:
SourceBut for more complicated functions, points-free style gets awkward quickly, especially if you don’t have other combinators like s. As soon as we want to use some variable twice, it’s usually easier to switch to lambda:
(mapc (lambda (x) (format t “~S (really ~S)~%” (round x) x))
numbers)
And that switch requires rewriting the whole function in a completely different way.Having more than one way to write functions is not in itself a problem, of course. The trouble is that I often want to transform between them, when a points-free expression grows to the point where it needs a lambda. At this point I have to stop thinking about what I want the code to do, and instead think about the trivia of combinators and variables. It’s only a minor annoyance, but it’s a very common one. And it’s more common in more points-free code, so it probably discourages good programming style.
May 17, 2012 2:06 am
From free cell phone ringtones on MySql Workbench is a total waste of time
"I like it so much, http://dailybooth.com/freecellphoneringto free cell phone ringtones, jsneke,..."