Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #55344

Re: Tail recursion to while iteration in 2 easy steps

From random832@fastmail.us
References <l2feu0$n61$1@ger.gmane.org> <mailman.619.1380717089.18130.python-list@python.org> <524c206d$0$29984$c3e8da3$5496439d@news.astraweb.com>
Subject Re: Tail recursion to while iteration in 2 easy steps
Date 2013-10-02 10:04 -0400
Newsgroups comp.lang.python
Message-ID <mailman.632.1380722697.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Wed, Oct 2, 2013, at 9:32, Steven D'Aprano wrote:
> Python is not as aggressively functional as (say) Haskell, but it is 
> surely an exaggeration to suggest that the failure to include tail call 
> optimization means that Python "rejects" functional programming styles. 
> You can still write you code in a functional style, it just won't be as 
> heavily optimized.

IMO, tail call optimization is essential to writing in a functional
style, since otherwise you end up with a stack overflow error on any
input above a trivial size.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Tail recursion to while iteration in 2 easy steps random832@fastmail.us - 2013-10-02 08:31 -0400
  Re: Tail recursion to while iteration in 2 easy steps Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-02 13:32 +0000
    Re: Tail recursion to while iteration in 2 easy steps random832@fastmail.us - 2013-10-02 10:04 -0400
      Re: Tail recursion to while iteration in 2 easy steps Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-10-02 19:13 +0000

csiph-web