Vocabulary
math

Inputs
na number
quotthe first quotation of an if-zero


Outputs
xan object


Word description
Makes an implicit check if the number is zero. A zero is dropped and the quot is called.

Examples
This word is equivalent to if-zero with an empty second quotation:
USING: math prettyprint ; 0 [ 4 ] [ ] if-zero .
4

USING: math prettyprint ; 0 [ 4 ] when-zero .
4


See also
if-zero, unless-zero, until-zero

Definition

: when-zero ( ... n quot: ( ... -- ... x ) -- ... x )
[ ] if-zero ; inline