In [[programming language theory]], a '''non-local variable''' (also '''free variable''' or '''upvalue''') is a variable that is not defined in the [[local scope]] (nor a [[function argument (computer science)|function argument]]). While the term can refer to global variables, it is primarily used in the context of [[nested function|nested]] and [[anonymous function]]s where some variables can be neither in the [[local scope|local]] nor the [[global scope]].