Deutsch   English   Français   Italiano  
<vefaq8$gn8u$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!3.eu.feeder.erje.net!feeder.erje.net!weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Ruvim <ruvim.pinka@gmail.com>
Newsgroups: comp.lang.forth
Subject: Re: Number parsing with checks
Date: Sun, 13 Oct 2024 06:20:55 +0400
Organization: A noiseless patient Spider
Lines: 38
Message-ID: <vefaq8$gn8u$1@dont-email.me>
References: <636c943eae41d9a5832ce5a94414cb81be04a44f@i2pn2.org>
 <vedv35$6b05$1@dont-email.me>
 <59b4fdfd0718fbe6e37c645925b7bf0b5ac86dde@i2pn2.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Sun, 13 Oct 2024 04:20:57 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="055583f00555671c87854758fc8e0208";
	logging-data="548126"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18/fXIngdG39IU5FBJpejsI"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:OOUG6ajbESbZRLCbcOoEUwO6oLE=
Content-Language: en-US
In-Reply-To: <59b4fdfd0718fbe6e37c645925b7bf0b5ac86dde@i2pn2.org>
Bytes: 2279

On 2024-10-13 05:13, dxf wrote:
> On 13/10/2024 12:54 am, Ruvim wrote:
>> On 2024-10-12 05:45, dxf wrote:
>>> The basics:
>>>
>>> : .BAD ( -- )  cr ." Invalid item"  .abort ;
>>>
>>> : 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)
> 
> It's rather similar.
> 
> ZE? NZ?  destructively tests TOS

But these words do not return a flag in the first output parameter. So, 
their names violate the common convention.


> ?ZE ?NZ  non-destructively tests TOS

These names follow the common convention. A question mark at the 
beginning of a name means that the word does something or does nothing 
depending on certain conditions.

Well known nonstandard words: `?stack` `?csp` `?comp` `?exec`
Standard words: `?do` `?dup`


> 
> Only difference is test and action are rolled into the one function.
> 


--
Ruvim