]> gitweb.factorcode.org Git - factor.git/blob - core/effects.facts
more sql changes
[factor.git] / core / effects.facts
1 IN: words
2 USING: help ;
3
4 HELP: effect
5 { $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." } ;
6
7 HELP: effect-height
8 { $values { "effect" "a stack effect" } { "n" "an integer" } }
9 { $description "Outputs the number of items added to the data stack by the stack effect. This will be negative if the stack effect only removes objects from the stack." } ;
10
11 HELP: effect<=
12 { $values { "eff1" "a stack effect" } { "eff2" "a stack effect" } { "?" "a boolean" } }
13 { $description "Tests if " { $snippet "eff1" } " can be used anywhere " { $snippet "eff2" } " can. What this means is that both stack effects change the stack height by the same amount, the first takes a smaller or equal number of inputs as the second, and either both or neither one terminate execution by throwing an error." } ;
14
15 HELP: effect>string
16 { $values { "effect" "a stack effect" } { "string" "a string" } }
17 { $description "Turns a stack effect object into a string mnemonic." }
18 { $examples
19     { $example "1 2 <effect> effect>string print" "( object -- object object )" }
20 } ;
21
22 HELP: stack-effect
23 { $values { "word" "a word" } { "effect/f" "a stack effect" } }
24 { $description "Outputs the stack effect of a word; either a stack effect declared with " { $link POSTPONE: ( } ", or an inferred stack effect (see " { $link "inference" } "." } ;