Sysop: | Amessyroom |
---|---|
Location: | Fayetteville, NC |
Users: | 43 |
Nodes: | 6 (0 / 6) |
Uptime: | 94:25:33 |
Calls: | 290 |
Calls today: | 1 |
Files: | 904 |
Messages: | 76,378 |
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.