Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.mb-net.net!open-news-network.org!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: BEGIN with multiple AGAINs? Date: Thu, 26 Jun 2014 18:34:47 -0400 Organization: Aioe.org NNTP Server Lines: 58 Message-ID: References: <59197a5d-9e3b-47b1-bf85-d883081c21e0@googlegroups.com> NNTP-Posting-Host: CNsg4fVcCsvs3UaOgZtQCw.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Opera Mail/12.16 (Linux) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:31902 On Sun, 15 Jun 2014 14:18:20 -0400, Alex McDonald wrote: > on 15/06/2014 13:36:11, "Rod Pemberton" wrote: >> On Sat, 14 Jun 2014 18:19:21 -0400, Alex McDonald >> wrote: >>> Andrew's factorial example demonstrates why having a jump rather >>> than a call is not correct. >> >> What! > > Tail-call elimination turns a call into a jump. >> >> Andrew's example has the *exact* same issue with RECURSE for which >> you cited me for. If you use a large factorial value in his example, >> RECURSE will overflow the stack with numbers to be multiplied long >> before the multiplication of the values can occur. >> > > No, I cited you for stack overflow unless it was possible to eliminate > the tail-call. You were offering RECURSE as an alternative to BEGIN ... > AGAIN, which does not have the problem. ... "the problem" ... Which problem? 1) the problem with my incorrectly implemented RECURSE looping forever? 2) the problem of stack overflow when using any correctly implemented RECURSE instead of BEGIN ... AGAIN ? > Andrew was demonstrating that your implementation of RECURSE was broken. You still haven't clarified if your "[citing me] for stack overflow unless it was possible to eliminate the tail-call" was a result of: 1) using a correctly implemented RECURSE 2) using a broken RECURSE I.e., it appears to me, that you cited me for the effects which occur when using a correctly implemented RECURSE, but touted Andrew's example as being correct which fails the exact same way when using a correctly implemented RECURSE: return stack growth from recursion. AM> "That would require tail-call elimination for RECURSE THEN ; AM> otherwise the return stack would grow uncontrollably." That's what happens with a correctly implemented RECURSE. It's what happens in Andrew's example too. Why am I being cited for it? It's not what happens with my (former) incorrectly implemented RECURSE. That removes the stacked return address, so the return stack didn't grow any. I.e., it doesn't fail by having "the return stack grow uncontrollably," yet, is is incorrectly implemented. Rod Pemberton