3 ms·
> lack of tail-call elimination But lisp doesn't need TCO.
by stassats 1y ago
> lack of tail-call elimination
But lisp doesn't need TCO.
- bevr1337 1y agoWhoa, what a surprising fact! I had not considered TCO in LISP was "nice to have." That's a good example where it's easy to hack but hard to make production ready.
- dreamcompiler 1y agoCommon Lisp doesn't technically require TCO but Scheme does. IMHO a Common Lisp without TCO is not a serious tool because I cannot write tail-recursive code with it.
- wavemode 1y agoTypical programming style in Common Lisp is procedural, not functional. The CL spec doesn't guarantee tail-call elimination, and most CL implementations don't guarantee it either (it could be on or off depending on the current optimization level). So most people don't bother relying on it.
- dreamcompiler 1y agoTrue. My CL code is atypical because I prefer functional style to iterative style. I know how to use declarations to turn on TCO for implementations that support it, which is most of the big ones. ABCL being a notable exception.