]> gitweb.factorcode.org Git - factor.git/blob - core/compiler/inference/branches.facts
212798a91b2f4b4f81dac0782e1baed83e76f663
[factor.git] / core / compiler / inference / branches.facts
1 IN: inference
2 USING: help interpreter kernel kernel-internals ;
3
4 HELP: unify-lengths
5 { $values { "seq" "a sequence" } { "newseq" "a new sequence" } }
6 { $description "Pads sequences in " { $snippet "seq" } " with computed value placeholders to ensure they are all the same length." } ;
7
8 HELP: unify-values
9 { $values { "seq" "a sequence" } { "value" "an object" } }
10 { $description "If all values in the sequence are equal, outputs the value, otherwise outputs a computed value placeholder." } ;
11
12 HELP: unbalanced-branches-error
13 { $values { "in" "a sequence of integers" } { "out" "a sequence of integers" } }
14 { $description "Throws an " { $link unbalanced-branches-error } "." }
15 { $error-description "Thrown when inference encounters an " { $link if } ", " { $link dispatch } " or " { $link cond } " where the branches do not all exit with the same stack height." }
16 { $notes "Conditionals with variable stack effects are considered to be bad style and should be avoided since they do not compile."
17 $terpri
18 "If this error comes up when inferring the stack effect of a recursive word, check the word's stack effect declaration; it might be wrong." } ;
19
20 HELP: unify-effect
21 { $values { "in" "a sequence of integers" } { "out" "a sequence of stacks" } { "newin" "a sequence of integers" } { "newout" "a sequence of stacks" } }
22 { $description "Unifies the stack effects of a number of branches, and outputs new values for " { $link d-in } " and " { $link meta-d } "." } ;