Re: Number parsing with checks

Liste des GroupesRevenir à cl forth 
Sujet : Re: Number parsing with checks
De : dxforth (at) *nospam* gmail.com (dxf)
Groupes : comp.lang.forth
Date : 13. Oct 2024, 03:59:55
Autres entêtes
Organisation : i2pn2 (i2pn.org)
Message-ID : <9bb57132c366402e72186ec8bbfe7eefdf085bbb@i2pn2.org>
References : 1 2 3 4
User-Agent : Mozilla Thunderbird
On 13/10/2024 1:20 pm, Ruvim wrote:
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.

Conventions are a guide.  Thankfully they're not yet a law.


Date Sujet#  Auteur
12 Oct 24 * Number parsing with checks17dxf
12 Oct 24 `* Re: Number parsing with checks16Ruvim
12 Oct 24  +* Re: Number parsing with checks4Ruvim
12 Oct 24  i`* Re: Number parsing with checks3mhx
12 Oct 24  i +- Re: Number parsing with checks1Ruvim
14 Oct 24  i `- Re: Number parsing with checks1Stephen Pelc
13 Oct 24  `* Re: Number parsing with checks11dxf
13 Oct 24   `* Re: Number parsing with checks10Ruvim
13 Oct 24    +* Re: Number parsing with checks8dxf
13 Oct 24    i`* Naming conventions (was: Number parsing with checks)7Ruvim
13 Oct 24    i `* Re: Naming conventions6dxf
13 Oct 24    i  +* Re: Naming conventions3Ruvim
13 Oct 24    i  i+- Re: Naming conventions1mhx
14 Oct 24    i  i`- Re: Naming conventions1dxf
14 Oct 24    i  `* Re: Naming conventions2Ruvim
14 Oct 24    i   `- Re: Naming conventions1dxf
14 Oct 24    `- Re: Number parsing with checks1dxf

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal