factor/library/compiler/inference/inference.facts

47 lines
2.7 KiB
Plaintext
Raw Normal View History

2006-03-25 01:06:52 -05:00
IN: inference
USING: compiler help kernel sequences ;
2006-08-01 17:35:00 -04:00
2006-08-16 21:55:53 -04:00
HELP: inference-error
2006-08-01 17:35:00 -04:00
{ $values { "msg" "an object" } }
{ $description "Throws an " { $link inference-error } "." }
{ $error-description
"Thrown by " { $link infer } ", " { $link dataflow } " and " { $link compile } " when the stack effect of a quotation cannot be inferred."
$terpri
"This error always delegates to one of the following classes of errors, which indicate the specific issue preventing a stack effect from being inferred:"
2006-08-01 17:35:00 -04:00
{ $list
{ $link no-effect }
{ $link literal-expected }
2006-08-18 18:47:41 -04:00
{ $link check-retain }
{ $link unbalanced-branches-error }
{ $link effect-error }
{ $link recursive-declare-error }
2006-08-01 17:35:00 -04:00
}
} ;
2006-03-25 01:06:52 -05:00
HELP: literal-expected
{ $error-description "Thrown when inference encounters a " { $link call } " or " { $link if } " being applied to a value which is not known to be a literal. Such a form can have an arbitrary stack effect, and does not compile." }
2006-08-18 03:51:41 -04:00
{ $notes "This error will be thrown when compiling any combinator, such as " { $link each } ". However, words calling combinators can compile of the combinator is declared " { $link POSTPONE: inline } " and the quotation being passed in is a literal." } ;
HELP: terminated?
{ $var-description "During inference, a flag set to " { $link t } " if the current control flow path unconditionally throws an error." } ;
2006-08-18 18:47:41 -04:00
HELP: check-retain
{ $error-description "Thrown if inference notices a quotation leaving behind elements on the retain stack." }
{ $notes "Usually this error indicates a coding mistake; check that usages of " { $link >r } " and " { $link r> } " are balanced in this case. Writing code which intentionally does this is considered bad style." } ;
2006-08-16 21:55:53 -04:00
HELP: infer
2006-03-25 01:06:52 -05:00
{ $values { "quot" "a quotation" } { "effect" "a pair of integers" } }
{ $description "Attempts to infer the quotation's stack effect, and outputs a pair holding the correct of data stack inputs and outputs for the quotation." }
{ $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ;
HELP: dataflow
{ $values { "quot" "a quotation" } { "dataflow" "a dataflow node" } }
{ $description "Attempts to construct a dataflow graph showing stack flow in the quotation." }
{ $notes "This is the first stage of the compiler." }
{ $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ;
HELP: dataflow-with
{ $values { "quot" "a quotation" } { "stack" "a vector" } { "dataflow" "a dataflow node" } }
{ $description "Attempts to construct a dataflow graph showing stack flow in the quotation, starting with an initial data stack of values." }
{ $errors "Throws an " { $link inference-error } " if stack effect inference fails." } ;