3 ms·
loop/recur is good for replacing structured loops but tail recursion is more general, since it can replace arbitrary gotos. One example is given by Guy Steele
by ufo 10y ago
loop/recur is good for replacing structured loops but tail recursion is more general, since it can replace arbitrary gotos.
One example is given by Guy Steele in "Why Object-Oriented Languages need Tail Calls". Basically, tail recursion lets you keep O(1) stack space even in the face of opaque method dispatching in OO code. https://eighty-twenty.org/2011/10/01/oo-tail-calls https://eighty-twenty.org/2011/10/01/oo-tail-calls
Another required reading are the "Lambda the Ultimate" papers, if you haven't read them yet. The "GOTO" one is particularly relevant here. http://library.readscheme.org/page1.html http://library.readscheme.org/page1.html
- DigitalJack 10y agoThanks! These must be where the website/blog got its name. I actually thought that was what you were referring to at first.