RosettaCodeData/Task/Empty-string/Forth/empty-string.fth

7 lines
297 B
Forth
Raw Permalink Normal View History

2015-11-18 06:14:39 +00:00
\ string words operate on the address and count left on the stack by a string
\ ? means the word returns a true/false flag on the stack
2013-04-10 16:57:12 -07:00
2015-11-18 06:14:39 +00:00
: empty? ( c-addr u -- ? ) nip 0= ;
: filled? ( c-addr u -- ? ) empty? 0= ;
: ="" ( c-addr u -- ) drop 0 ; \ It's OK to copy syntax from other languages