> Keep in mind that the classic MIT lectures on programming used to be in Lisp and original Lisp didn't have loops, only those "tail recursions".
I know pretty well, and that's not just Lisp. At $job-2, we had a significant codebase in Erlang, which doesn't have loops, either.
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
| [reply] [d/l] |
| [reply] |
You can define an (infinite, FSVO infinite limited by your patience and available RAM) list without defining a new function, just summing itself with the rest of itself: fibs = 0 : 1 : zipWith (+) fibs (tail fibs), and then you can get the first however many you need with take. Once realized it won't have to recompute anything again.
(I did have to crib from a wiki because I couldn't remember if it was just zip or not.)
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] [d/l] [select] |
The nerf ball skirmish rages, "What is an apposite non-pedagogical example of recursion?" the casus belli; then, a pause: From a foxhole betwixt comes a plaintive query, "How about Quicksort?"
| [reply] |