Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.ecp.fr!aioe.org!.POSTED!not-for-mail From: "Rod Pemberton" Newsgroups: comp.lang.forth Subject: Re: BEGIN with multiple AGAINs? Date: Sun, 15 Jun 2014 08:23:47 -0400 Organization: Aioe.org NNTP Server Lines: 25 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:31552 On Sat, 14 Jun 2014 05:32:08 -0400, Andrew Haley wrote: > Try this: > > : factorial ?dup 0= if 1 else dup 1- recurse * then ; ok > 5 factorial . 120 ok > So, Forth requires that RECURSE be broken, i.e., potentially overflows. I should've guessed that any attempt I made to fix Forth, i.e., make it safer and more useful would be a waste of my time. Not be able to call the same word forever with RECURSE definately eliminates most, if not all, of it's serious use, IMO. It's difficult to control the level to which a recursive word will nest. It's very likely to overflow many of the situations where one would use it, such as sorting, and even your example above with a sufficiently large value. Eventually, I would've noticed that my RECURSE didn't work correctly, since it doesn't pass my own test for it, and the R> DROP probably causes Hayes core to fail too. Rod Pemberton