23 lines
1.4 KiB
Plaintext
23 lines
1.4 KiB
Plaintext
|
IN: inference
|
||
|
USING: help interpreter kernel kernel-internals ;
|
||
|
|
||
|
HELP: unify-lengths
|
||
|
{ $values { "seq" "a sequence" } { "newseq" "a new sequence" } }
|
||
|
{ $description "Pads sequences in " { $snippet "seq" } " with computed value placeholders to ensure they are all the same length." } ;
|
||
|
|
||
|
HELP: unify-values
|
||
|
{ $values { "seq" "a sequence" } { "value" "an object" } }
|
||
|
{ $description "If all values in the sequence are equal, outputs the value, otherwise outputs a computed value placeholder." } ;
|
||
|
|
||
|
HELP: unbalanced-branches-error
|
||
|
{ $values { "in" "a sequence of integers" } { "out" "a sequence of integers" } }
|
||
|
{ $description "Throws an " { $link unbalanced-branches-error } "." }
|
||
|
{ $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." }
|
||
|
{ $notes "Conditionals with variable stack effects are considered to be bad style and should be avoided since they do not compile."
|
||
|
$terpri
|
||
|
"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." } ;
|
||
|
|
||
|
HELP: unify-effect
|
||
|
{ $values { "in" "a sequence of integers" } { "out" "a sequence of stacks" } { "newin" "a sequence of integers" } { "newout" "a sequence of stacks" } }
|
||
|
{ $description "Unifies the stack effects of a number of branches, and outputs new values for " { $link d-in } " and " { $link meta-d } "." } ;
|