Path: ...!weretis.net!feeder9.news.weretis.net!news.nk.ca!rocksolid2!i2pn2.org!.POSTED!not-for-mail From: mhx@iae.nl (mhx) Newsgroups: comp.lang.forth Subject: Re: Number parsing with checks Date: Sat, 12 Oct 2024 16:40:07 +0000 Organization: novaBBS Message-ID: References: <636c943eae41d9a5832ce5a94414cb81be04a44f@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: i2pn2.org; logging-data="1726644"; mail-complaints-to="usenet@i2pn2.org"; posting-account="J+nubxJRM7ncpF4l6KLO+OONWmFAYJHVJegfwQXJ8vc"; User-Agent: Rocksolid Light X-Spam-Checker-Version: SpamAssassin 4.0.0 X-Rslight-Posting-User: 4e0dc1fdad1ead10b39e7eb5db19bf73d73e3ab3 X-Rslight-Site: $2y$10$YWJy.9/dtw.snfdC3GfYy.NFbTzmTscnZzoQDbHx6sst6OpvIRBiS Bytes: 1850 Lines: 30 On Sat, 12 Oct 2024 14:46:52 +0000, Ruvim wrote: > On 2024-10-12 17:54, Ruvim wrote: >> On 2024-10-12 05:45, dxf wrote: >>> The basics: [..] >>> : ZE? ( x -- )  if .bad then ;     \ abort if non-zero >>> : NZ? ( x -- )  0= ze? ;           \ abort if zero >> >> Typically, if word name ends with a question mark, the first (top) >> output parameter of the word is a *flag*. And it's true for all >> standard words. (though, opposite is not true) >> >> These are better names and narrower stack diagrams: >> >>   DROP-NZ ( x\0 --  |  0 -- never ) >>   DROP-ZE ( 0 --  |  x\0 -- never ) > > I do not like these names too. > > These seem better: > > ?NZ-DROP > ?ZE-DROP [..] My convention has always been that if a word starts with a '?', it tests and [possibly] aborts. This makes '-DROP' unnecessary. -marcel