ExpressionChecker wraps around a bit of context that makes
recursion through Expression objects easier. Concretely
scope: ... is a lookup function for the types of variables,
which the Typechecker has no way to figure out on
its own. The easiest way to pull this off is to simply
pass a Map[String,TAny] object, as its apply() method
will do the trick, but it's handy to leave this open
to any lookup function. The scope doesn't need to be
present for the typechecker to work, but if it isn't
then it'll fail if it hits any Var object.
context : ... is an operator for debugging purposes. If
any typechecker error occurs, then we'll annotate the
error with this operator.
ExpressionChecker wraps around a bit of context that makes recursion through Expression objects easier. Concretely
scope
: ... is a lookup function for the types of variables, which the Typechecker has no way to figure out on its own. The easiest way to pull this off is to simply pass a Map[String,TAny] object, as its apply() method will do the trick, but it's handy to leave this open to any lookup function. The scope doesn't need to be present for the typechecker to work, but if it isn't then it'll fail if it hits any Var object.context
: ... is an operator for debugging purposes. If any typechecker error occurs, then we'll annotate the error with this operator.