execute-effect ( word effect -- ) (original) (raw)

Vocabulary
combinators

Inputs

word a word
effect an effect

Outputs
None

Word description
Given a word and a stack effect, executes the word, asserting at runtime that it has the given stack effect. This is a macro which expands given a literal effect parameter, and an arbitrary word which is not required at compile time.

Examples
The following two lines are equivalent:

execute( a b -- c ) ( a b -- c ) execute-effect

See also
call-effect, call-effect-unsafe, execute-effect-unsafe

Definition

USING: kernel ;

IN: combinators

: execute-effect ( word effect -- )
[ [ execute ] curry ] dip call-effect ;