Many functions discussed in this chapter are not completely tail recursive, but are almost tail recursive. In these functions, the recursive call comes just before an arithmetic operation, which is the last operation in the function. For example, factorial and length of a list are almost tail recursive in this sense. Describe a general pattern for turning an almost tail-recursive function into a loop, in the same way that a tail-recursive function can be so transformed, as described in Section 3.1. Can a translator recognize almost tail recursion as easily as tail recursion? How might it do so?
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here