Lua uses a concept called &quot;upvalues&quot; to refer to variables from enclosing scopes.  The main observation here seems to be that you can statically determine a unique index for all local variables in any enclosing scope.  I&#x27;m not sure exactly how the details work in cases where there are sibling scopes, but anyway it seems like a useful concept and i am surprised the concept&#x2F;terminology is not more common.