3 ms·
Specifically, loops are a special case (with special syntax) of tail calls for language that don't support tail calls properly. However as great as tail calls
by eru 4y ago
Specifically, loops are a special case (with special syntax) of tail calls for language that don't support tail calls properly.
However as great as tail calls are they can't practically implement all control flow concepts. Eg they aren't really all that great for modelling exceptions, I think.
- pjmlp 4y agoFair point, however exceptions have their roots on continuations.
- throwaway17_17 4y agoI would agree with sibling, and expand his comment a bit. Tail calls are just the specialization of continuation passing (or of having reified continuations programmer accessible. Actually, all control flow is the application of a continuation. So while I agree that tail calls are not used as the basis for exceptions, the parent concept of continuation passing does.