call-effect ( quot effect -- )
Factor handbook » The language » Combinators » Fundamental combinators

Prev:execute(
Next:execute-effect ( word effect -- )


Vocabulary
combinators

Inputs
quota quotation
effectan effect


Outputs
None

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

Notes
The runtime check requires enough values for the declared inputs and outputs, the declared change in stack height, and an unchanged stack prefix below the inputs. It checks the resulting stack rather than tracing every access made by the quotation.

With the optimizing compiler loaded, interpreted and compiled calls reject a known incompatible effect before executing the callable. If its effect cannot be inferred, the runtime result check is used.

Examples
The following two lines are equivalent:
call( a b -- c ) ( a b -- c ) call-effect


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

Definition