| ▲ | pfdietz an hour ago | |||||||
Even SBCL doesn't do TCO at all times. Compiling at (debug 3) means no TCO. Another related footgun is deep recursion of other kinds, for example when recursively traversing down lists. For long lists it's easy to exceed the stack size limit. The common idiom is to recur on list elements, but iterate or map to go along a list. | ||||||||
| ▲ | guenthert an hour ago | parent [-] | |||||||
> Even SBCL doesn't do TCO at all times. Compiling at (debug 3) means no TCO. Presumably one intends to debug the code, when setting (debug 3). Then it'll be helpful to see the stack, no? > Another related footgun is deep recursion of other kinds, for example when recursively traversing down lists. For long lists it's easy to exceed the stack size limit. The common idiom is to recur on list elements, but iterate or map to go along a list. Not going to argue with seasoned lispers here, but IMHO recursive code makes most sense when accessing recursive data structures. | ||||||||
| ||||||||