unless* ( ..a ? false: ( ..a -- ..a x ) -- ..a x )
Factor handbook > The language > Combinators > Conditional combinators

Prev:when* ( ..a ? true: ( ..a ? -- ..a ) -- ..a )
Next:?if ( ..a default cond true: ( ..a cond -- ..b ) false: ( ..a default -- ..b ) -- ..b )


Vocabulary
kernel

Inputs and outputs
?a generalized boolean
falsea quotation with stack effect ( ..a -- ..a x )
xan object


Word description
Variant of if* with no true quotation.

Notes
The following two lines are equivalent:
X [ Y ] unless* X dup [ ] [ drop Y ] if


Definition

: unless* ( ..a ? false: ( ..a -- ..a x ) -- ..a x )
over [ drop ] [ nip call ] if ; inline