Re: Why no tailcall-optimization?

2008-09-23 Thread Rhamphoryncus
On Sep 22, 7:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Re: Why no tailcall-optimization?

2008-09-23 Thread Jean-Paul Calderone
On Tue, 23 Sep 2008 06:41:33 -0700 (PDT), sturlamolden <[EMAIL PROTECTED]> wrote: On Sep 23, 3:13 am, process <[EMAIL PROTECTED]> wrote: Why doesn't Python optimize tailcalls? Are there plans for it? Because Python is a dynamic language. While a function is executing, its name may be bound t

Re: Why no tailcall-optimization?

2008-09-23 Thread sturlamolden
On Sep 23, 3:13 am, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? Because Python is a dynamic language. While a function is executing, its name may be bound to another object. It may happen as a side effect of what the function is doing, or ev

Re: Why no tailcall-optimization?

2008-09-23 Thread Carl Banks
On Sep 22, 9:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? The main technical difficulty is that the compiler has to know whether the function returns a tail call or not at compile time. But because Python is fully dynamic with regard t

Re: Why no tailcall-optimization?

2008-09-23 Thread Terry Reedy
process wrote: Why doesn't Python optimize tailcalls? Are there plans for it? I started to write an article on this but it disappeared So short answer: 1. Unless down very carefully, in a way that would slow things down, it would change the semantics of Python. 2. It is usually trivial to

Re: Why no tailcall-optimization?

2008-09-23 Thread Bruno Desthuilliers
process a écrit : Why doesn't Python optimize tailcalls? Design choice. tail-recursive calls optimization makes debugging harder. Note that this has been discussed quite a few times here. Are there plans for it? I know GvR dislikes some of the functional additions like reduce and Python is

Re: Why no tailcall-optimization?

2008-09-22 Thread Michael Palmer
On Sep 22, 9:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Re: Why no tailcall-optimization?

2008-09-22 Thread Aaron "Castironpi" Brady
On Sep 22, 8:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Why no tailcall-optimization?

2008-09-22 Thread process
Why doesn't Python optimize tailcalls? Are there plans for it? I know GvR dislikes some of the functional additions like reduce and Python is supposedly about "one preferrable way of doing things" but not being able to use recursion properly is just a big pain in the a**. -- http://mail.python.or