Path: csiph.com!news.redatomik.org!aioe.org!.POSTED!not-for-mail From: Rod Pemberton Newsgroups: comp.lang.forth Subject: Re: EXIT THEN Date: Wed, 18 Jan 2017 08:02:51 -0500 Organization: Aioe.org NNTP Server Lines: 41 Message-ID: <20170118080251.08615130@_> References: NNTP-Posting-Host: n4wpt9zq8xR26Ttf9mo2BA.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org X-Newsreader: Claws Mail 3.13.1 (GTK+ 2.24.13; x86_64-unknown-linux-gnu) X-Notice: Filtered by postfilter v. 0.8.2 Xref: csiph.com comp.lang.forth:54116 On Tue, 17 Jan 2017 12:17:01 +1100 "HAA" wrote: > Noticing how many times I was using the sequence EXIT THEN I did some > research and discovered not surprisingly I was not alone. > > SwiftForth 227 > VFX 533 > GForth 358 > Win32Forth 359 > > Typically found in IF conditionals EXIT THEN avoids the need for ELSE > and the unnecessary jump it would otherwise compile. > > Given the frequent usage and my use of screens, I'm considering a > macro to replace EXIT THEN. I've chosen the name END. END was once a > synonym for UNTIL (FigForth & F79/83 reference words) but who even > remembers that today let alone uses it. IMO the new use for END > better befits the name. > > : END POSTPONE EXIT POSTPONE THEN ; IMMEDIATE > > [from a later post] > > In > SwiftForth REPEAT occurs 213 times which is *less* than EXIT THEN. > The only question is how all this has remained in plain sight for > decades apparently without anybody noticing. For threaded code, migrating to END would conserve some memory, which might be useful for an embedded environment. But, defining END and using it instead of EXIT THEN would also slow down the address interpreter. There is additional overhead to switch the thread being interpreted from one word to another and back. So, AISI, if speed is a concern, using END could make sense for threaded code, if END is implemented as a primitive or low-level word, i.e., not defined in high-level Forth. Rod Pemberton