Python's "only one way to do it" philosophy isn't good?

Steve Howell showell30 at yahoo.com
Wed Jun 13 00:15:22 EDT 2007


--- John Nagle <nagle at animats.com> wrote:
> 
>     There's a real reason.  Remember, functions are
> dynamically
> replaceable.  The compiler would have to detect that
> the function
> doesn't modify or replace itself while recursing for
> this optimization
> to be valid.  Worst case, another thread could
> replace the function
> while it was recursing, invalidating the tail
> recursion optimization.
> 

You would just change the language definition to say
that once you enter f(), any call to f() from within
f() behaves as if the recursively called f() still
points to the originally bound version of f.  To want
any other behavior would be absurd, anyhow. 

I could see the utility of this restriction even
without optimization.
 


       
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow  



More information about the Python-list mailing list