effect
Factor documentation > Factor handbook > Developer tools > Stack effect tools
Prev:effect= ( effect1 effect2 -- ? )
Next:effect? ( object -- ? )


Vocabulary
effects

Class description
An object representing a stack effect. Holds a sequence of inputs, a sequence of outputs and a flag indicating if an error is thrown unconditionally.

Definition
USING: arrays ;

IN: effects

TUPLE: effect
{ in array read-only initial: { } }
{ out array read-only initial: { } }
{ terminated? read-only } { in-var read-only }
{ out-var read-only } ;


Methods
USING: accessors effects kernel ;

M: effect clone [ in>> clone ] [ out>> clone ] bi <effect> ;


USING: compiler.tree.propagation.call-effect effects ;

M: effect curry-effect* curry-effect ;


USING: accessors effects kernel make ;

M: effect effect>string
[
"( " % dup in-var>> var-picture %
dup in>> stack-picture % "-- " %
dup out-var>> var-picture % dup out>> stack-picture %
dup terminated?>> [ "* " % ] when drop ")" %
] "" make ;


USING: effects prettyprint.custom prettyprint.sections ;

M: effect pprint* effect>string text ;


USING: effects present ;

M: effect present effect>string ;