Article View: alt.folklore.computers
Article #623798Re: The dictionary definition of recursion
From: John Levine
Date: Tue, 05 Jun 2018 10:46
Date: Tue, 05 Jun 2018 10:46
23 lines
2236 bytes
2236 bytes
In article <jqrbhdd0i6o7mlhsu...@4ax.com>,
J. Clarke <jclarke...@gmail.com> wrote:
>Noting that the above were all implemented with some version of:
>
>fact(x){
> if x = 0 or x= 1 then return 1
> else return x * fact(x-1)
>}
>
>That the optimized functions included in system libraries do factorial
>efficiently doesn't have any relevance to the issue of whether a
>recursive solution will complete and not crash.
It's more relevant whether the compiler is smart enough to turn tail
recursoin into interative code. If not, a whole lot of languages deal
very poorly with stack overflows.
--
Regards,
John Levine, jo...@iecc.com, Primary Perpetrator of "The Internet for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
Technical Details
Message-ID:
<pf5pn1$872$2@gal.iecc.com>Path:
mbox-mo1.pugleaf.net!z3-v6ni576iti.0!nntp.google.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mailReferences:
<pf3oke$hq8$1@dont-email.me> <a50ca27b-e56e-4b7f-b365-637c299866e9@googlegroups.com> <pqjbhd5l8uats7rrgmci77r33vmvssnlu7@4ax.com> <jqrbhdd0i6o7mlhsuerak35scut6gdkd2p@4ax.com>Show Full Headers
Complete Article Headers
X-Received: by 2002:a24:d301:: with SMTP id n1-v6mr11426457itg.17.1528195618123; Tue, 05 Jun 2018 03:46:58 -0700 (PDT) X-BeenThere: alt.folklore.computers@googlegroups.com Received: by 2002:a6b:510e:: with SMTP id f14-v6ls4063642iob.21.gmail; Tue, 05 Jun 2018 03:46:57 -0700 (PDT) X-Received: by 2002:a6b:6d19:: with SMTP id a25-v6mr6171149iod.16.1528195617433; Tue, 05 Jun 2018 03:46:57 -0700 (PDT) MIME-Version: 1.0 Path: mbox-mo1.pugleaf.net!z3-v6ni576iti.0!nntp.google.com!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!not-for-mail From: John Levine <jo...@taugh.com> Newsgroups: alt.folklore.computers Subject: Re: The dictionary definition of recursion Date: Tue, 5 Jun 2018 10:46:57 -0000 (UTC) Organization: Taughannock Networks Message-ID: <pf5pn1$872$2@gal.iecc.com> References: <pf3oke$hq8$1@dont-email.me> <a50ca27b-e56e-4b7f-b365-637c299866e9@googlegroups.com> <pqjbhd5l8uats7rrgmci77r33vmvssnlu7@4ax.com> <jqrbhdd0i6o7mlhsuerak35scut6gdkd2p@4ax.com> Injection-Date: Tue, 5 Jun 2018 10:46:57 -0000 (UTC) Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="8418"; mail-complaints-to="ab...@iecc.com" Cleverness: some X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: jo...@iecc.com (John Levine) Bytes: 1706 Lines: 22 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit