Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'wed,': 0.03; 'function:': 0.09; 'plus)': 0.09; 'def': 0.12; 'am,': 0.14; 'wrote:': 0.14; 'defined': 0.14; '9:15': 0.16; 'mathematics.': 0.16; 'recursive': 0.16; 'matching': 0.16; '(i.e.': 0.17; 'cc:addr:python-list': 0.17; 'programming': 0.19; 'header:In-Reply-To:1': 0.21; 'cc:2**0': 0.22; 'cc:no real name:2**0': 0.23; 'received:209.85.161.46': 0.23; 'received:mail- fx0-f46.google.com': 0.23; '(or': 0.24; 'function': 0.25; 'definition': 0.26; 'received:209.85.161': 0.26; 'saying': 0.26; '(in': 0.26; 'message-id:@mail.gmail.com': 0.28; 'cc:addr:python.org': 0.30; 'putting': 0.30; 'else': 0.35; 'uses': 0.36; 'received:google.com': 0.37; 'something': 0.37; 'received:209.85': 0.37; 'put': 0.37; 'subject:: ': 0.38; 'explain': 0.39; 'received:209': 0.39; 'under': 0.40; 'format': 0.40; 'addition': 0.60; 'not:': 0.91; 'subject:English': 0.91; 'technique': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=MGY+ZdNZ6Bv0Gc7UBLTBySgiOT6/vMSD4oMqjb9tDIc=; b=VZFaHGm6aGlu5C3Od8HFBNaet3c1l+fLUY2baguo5hjGWuqCcqxlivEQSjEGO0hB3X IhY/tIozc/av+zO9RH+vuPAxotI+LyVzgCs6i1krLo8AKsTbjjMDLNbj0z3UslViRWqM L7Jnr6KefJBE3H/i8GH7VCclN6O9SYczPkezU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=EVwpSrhgHvxL+bbK5L+KMuftwUHZlDlufTQ8tC8EznlYPaXnys4Q/JCEqEZE0wQGbz YhfVYOFylJ4XkqzklUfA6sY+TbahwNVP0bIw7P5M1YzGkXc57CdrU3pzoo6mDs8ElrGh veZsh4n0aQ/SaS6G2s1d/C+dZSjjMJ+gDH0hI= MIME-Version: 1.0 In-Reply-To: <488559dd-b1a4-4b81-8d53-40f0af9773c0@d26g2000prn.googlegroups.com> References: <2acf55f1-0415-4a13-8e16-aa3418d149c2@r35g2000prj.googlegroups.com> <436ff55b-f61d-46a8-b5ea-f29d73190aba@s41g2000prb.googlegroups.com> <488559dd-b1a4-4b81-8d53-40f0af9773c0@d26g2000prn.googlegroups.com> From: Ian Kelly Date: Wed, 18 May 2011 09:43:24 -0600 Subject: Re: English Idiom in Unix: Directory Recursively To: rusi Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305733439 news.xs4all.nl 49045 [::ffff:82.94.164.166]:38523 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5705 On Wed, May 18, 2011 at 9:15 AM, rusi wrote: >> What you're failing to explain is why you would consider that function >> to be recursive from a programming standpoint. > > As for putting + under the format of primitive recursion, it would go > something like this (I guess) > > Matching up that definition > Put > h is what is being defined ie + (or plus) > k = 1 > f = id > g(y, ic, x) = S(ic) #ignore y and x, ic is internal (recursive) call > > Gives > > plus(0, x) = x > plus((S y), x) = S(plus(y, x)) You're still arguing mathematics. I am not disputing that the addition function is primitive recursive (in fact, I asserted that in my original reply). What I am saying is that this *implementation* of the addition function: def add(x, y): return y if x == 0 else add(x-1, y) + 1 is recursive in the programming sense (i.e. it uses the programming technique of recursion), while this implementation is not: def add(x, y): return x + y