[EMAIL PROTECTED] (Aahz) writes: > In article <[EMAIL PROTECTED]>, > Paul Rubin <http://[EMAIL PROTECTED]> wrote: >>Every serious FP language implementation optimizes tail calls and thus >>using recursion instead of iteration doesn't cost any stack space and >>it probably generates the exact same machine code. > While that's true, one of the reasons Guido has historically rejected > this optimization is because there are plenty of recursive algorithms > not amenable to tail-call optimization.
That seems amazingly silly. Sort of like refusing to hoist function definitions because not all function definitions can be hoisted. Or choose your favorite "sometimes-I-can-sometimes-I-can't" optimization. Since the BDFL is *not* known for doing even mildly silly things when it comes to Python's design and implementation, I suspect there's more to the story than that. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list