<effect> ( in out -- effect )
Factor handbook » The language » Stack effect declarations

Prev:Stack effect row variables
Next:<terminated-effect> ( in out terminated? -- effect )


Vocabulary
effects

Inputs
ina sequence of strings or string–type pairs
outa sequence of strings or string–type pairs


Outputs
effectan effect


Word description
Constructs an effect object. Each element of in and out must be either a string, which is equivalent to a name in literal stack effect syntax, or a pair where the first element is a string and the second is either a class or effect, which is equivalent to name: class or name: ( nested -- effect ) in the literal syntax. If the out array consists of a single string element "*", a terminating stack effect will be constructed.

Notes
This word cannot construct effects with Stack effect row variables. Use <variable-effect> to construct variable stack effects.

Examples
USING: effects prettyprint ; { "a" "b" } { "c" } <effect> .
( a b -- c )

USING: arrays effects prettyprint ; { "a" { "b" array } } { "c" } <effect> .
( a b: array -- c )

USING: effects prettyprint ; { "a" { "b" ( x y -- z ) } } { "c" } <effect> .
( a b: ( x y -- z ) -- c )

USING: effects prettyprint ; { "a" { "b" ( x y -- z ) } } { "*" } <effect> .
( a b: ( x y -- z ) -- * )


See also
<terminated-effect>, <variable-effect>

Definition