if-void ( ..a c-type true: ( ..a -- ..b ) false: ( ..a c-type -- ..b ) -- ..b ) (original) (raw)

if-void ( ..a c-type true: ( ..a -- ..b ) false: ( ..a c-type -- ..b ) -- ..b )

Vocabulary
alien.c-types

Inputs

c-type an object
true a quotation with stack effect ( ..a -- ..b )
false a quotation with stack effect ( ..a c-type -- ..b )

Outputs
None

Definition

USING: kernel ;

IN: alien.c-types

: if-void
( ..a c-type true: ( ..a -- ..b ) false: ( ..a c-type -- ..b ) -- ..b )
pick void? [ drop nip call ] [ nip call ] if ; inline