Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!goblin3!goblin.stu.neva.ru!newsfeed2.funet.fi!newsfeeds.funet.fi!news.helsinki.fi!.POSTED!not-for-mail From: Jussi Piitulainen Newsgroups: comp.lang.python Subject: Re: Feature suggestion -- return if true Date: 19 Apr 2011 09:42:12 +0300 Organization: University of Helsinki Lines: 20 Sender: jpiitula@ruuvi.it.helsinki.fi Message-ID: References: <8abff237-5ccd-4eb6-85c8-cdc9e87520b7@bl1g2000vbb.googlegroups.com> <90v871FkuaU1@mid.individual.net> <4daaa8a0$0$29986$c3e8da3$5496439d@news.astraweb.com> <4DAB9C3F.20801@ieee.org> <9143muFb0mU1@mid.individual.net> NNTP-Posting-Host: ruuvi.it.helsinki.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: oravannahka.helsinki.fi 1303195332 18665 128.214.205.65 (19 Apr 2011 06:42:12 GMT) X-Complaints-To: usenet@oravannahka.helsinki.fi NNTP-Posting-Date: Tue, 19 Apr 2011 06:42:12 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:3543 Gregory Ewing writes: > Chris Angelico wrote: > > > Question: How many factorial functions are implemented because a > > program needs to know what n! is, and how many are implemented to > > demonstrate recursion (or to demonstrate the difference between > > iteration and recursion)? :) (I can't get to the parent directly, so I follow up indirectly.) Factorials become an interesting demonstration of recursion when done well. There's a paper by Richard J. Fateman, citing Peter Luschny: Fateman's "major conclusion is that you should probably not use the 'naive' factorial programs for much of anything". I take this to include their use as examples of recursion, unless the purpose is to make the idea of recursion look bad.