4 ms·
Yup. The CL spec does not require TCO. Some implementations only do TCO on self calls, so no mutual recursion. And really i think the "Classic" lisp way to loo
by jfoutz 11y ago
Yup. The CL spec does not require TCO. Some implementations only do TCO on self calls, so no mutual recursion.
And really i think the "Classic" lisp way to loop is loop, not recursion.
Scheme forces the point and requires full TCO.
- hga 11y agoAnd really i think the "Classic" lisp way to loop is loop, not recursion. Both, I think (from long ago memories). The "modern" loop macro (which is probably Turing complete like I seem to remember people saying format is :-) is I think a relatively new thing, I overhead a lot of discussion about its design in the early '80s. Although it probably had precursors, mainline Lisp, now Common Lisp, is decidedly multi-paradigm, there were even sops thrown to FORTRAN programmers as I recall, probably back from when there were only a very few computer languages in existence (heck, LISP's first implementation, on a vacuum tube computer, was as FORTRAN subroutines). So overt things like loop are in theory idiomatic as well as recursion.
- lispm 11y agoMost CL implementations will do more TCO than on self calls or mutual recursion. Most support full TCO, with language limitations. The ones that don't provide any form of TCO are old Lisp Machine implementations and ABCL on the JVM. SBCL, OTOH, provides full TCO. Some older overview about Common Lisp implementations and their TCO support: http://0branch.com/notes/tco-cl.html http://0branch.com/notes/tco-cl.html
- ohyes 11y agoI seem to recall it depending on compiler settings whether sbcl does tco. Which means you probably don't want to rely on it in general unless you are okay being locked to a specific implementation and specific optimization settings that may-or-may not seem magical to the uninformed user.
- lispm 11y agoThere is Common Lisp software which needs TCO and only runs in TCO supporting implementations.