when-positive ( ..a n quot: ( ..a n -- ..b ) -- ..b )


Vocabulary
math.combinators

Inputs
na real
quotthe first quotation of an if-positive


Outputs
None

Word description
When n is positive, calls the quotation with n.

Examples
USING: math math.combinators prettyprint ; 1.5 [ 1 + ] when-positive .
2.5

USING: math math.combinators prettyprint ; -1 [ 1 + ] when-positive .
-1


Definition

: when-positive ( ..a n quot: ( ..a n -- ..b ) -- ..b )
[ ] if-positive ; inline