You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A better model for typechecking blocks might be to introduce a type Closure which is similar to the current Scope (or SubScope). This contains all the locals declared, globals assigned, and globals constrained in the block. Typechecking a block returns this closure object; this can then be applied to the parent scope (closure), or interpreted similar to the current Scope.
Note that the same variable name could appear as a local, assigned and constrained global, e.g.:
do
local _ = x .. "foo"
x = 333
local _ = x + 5
local x = "sss"
end
This is valid, but the x before and after the global assignment, as well as the local x, are all distinct in view of the closure.
The text was updated successfully, but these errors were encountered:
A better model for typechecking blocks might be to introduce a type
Closure
which is similar to the currentScope
(orSubScope
). This contains all the locals declared, globals assigned, and globals constrained in the block. Typechecking a block returns this closure object; this can then be applied to the parent scope (closure), or interpreted similar to the currentScope
.Note that the same variable name could appear as a local, assigned and constrained global, e.g.:
This is valid, but the
x
before and after the global assignment, as well as the localx
, are all distinct in view of the closure.The text was updated successfully, but these errors were encountered: