functional programming & tail recursion?

Justin Sheehy dworkin at ccs.neu.edu
Tue Feb 29 10:14:48 EST 2000


"Dennis E. Hamilton" <infonuovo at email.com> writes:

> I can't imagine any language providing a very good result for
> 
> 	def fib(n):
>           assert n = int(n) and n = abs(n)
>           if n in [0, 1]:
>               return n
>           return fib(n-1) + fib(n-2)

Sure, but how is that relevant?  There are no tail calls here.

-Justin

 




More information about the Python-list mailing list