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: ( default -- new/f ) true: ( ..a new -- ..b ) false: ( ..a default -- ..b ) -- ..b )


Vocabulary
kernel

Inputs
?a generalized boolean
falsea quotation with stack effect ( ..a -- ..a x )


Outputs
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