Path: csiph.com!aioe.org!.POSTED!not-for-mail From: "HAA" Newsgroups: comp.lang.forth Subject: Re: EXIT THEN Date: Wed, 8 Feb 2017 19:43:46 +1100 Organization: Aioe.org NNTP Server Lines: 59 Message-ID: References: <40682dd5-ba45-4b07-bd5c-7974b1119e78@googlegroups.com> <42c0521f-942a-43ca-8a08-2381f93b0a13@googlegroups.com> <2017Jan26.120712@mips.complang.tuwien.ac.at> <2017Feb7.185415@mips.complang.tuwien.ac.at> NNTP-Posting-Host: rFY689DdHBCZ+o3fZKM56Q.user.gioia.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 X-MSMail-Priority: Normal X-Priority: 3 Xref: csiph.com comp.lang.forth:54712 Anton Ertl wrote: > "HAA" writes: > >I would just write: > > > >begin > > n1 of ... end > > n2 of ... end > > condition if ... end > >again > > Interestingly, I had to look at this for quite a while to understand > that; despite this END being discussed recently and quite at length > here, the usage here just slipped past my radar. That might change if > it catches on, but I don't see it as beneficial enough to justify the > transition cost. There is no transition cost as far as I can see. Everything remains backward compatible. CASE OF ENDOF ENDCASE in old code works just as before. END does for Case statements what ELSE elimination does elsewhere. It would be fair to ask how often does it occur. In my experience more often than not. In a recent application I employed 11 case statements. Of these, 9 were using ENDOF for no other reason than ANS expected it. With a suitable implementation of OF, END can replace ENDOF and as a bonus CASE and ENDCASE in these definitions can also be removed. No more issues with the built-in DROP in ENDCASE which most agree was more trouble than it was worth. > > That being said, I like the general concept better than ?EXIT, because > there often is cleanup work that has to be done before EXITing, so > ?EXIT is really wrong factoring, but at least the ?EXIT name does not > need any getting-used to in order to see what's going on. Would ?EXIT have existed had somebody noticed EXIT THEN occurs far more frequently? I doubt it. > ... > The downsides are that you need to CATCH the conditions, and that > CATCH and THROW are typically not the fastest words around around. Hence the word UNLOOP. But at least you can replace the EXIT THEN that follows with END. > > >It's 2017. Not 1994 when nobody knew any better. > > I don't see that using EXIT THEN or a macro for it is anything that we > learned after 1994. > > - anton Perhaps it is now clearer. Adding new Case words in 2017 based on a 1994 definition of OF would be tantamount to having learnt nothing. Better to deal with the problem that prompted these words.