Non-local variable: Difference between revisions

Content deleted Content added
No edit summary
Tags: Reverted Mobile edit Mobile web edit
m Reverted edits by 2601:1C2:4E02:AE60:A9CA:A01C:7B73:DEAB (talk) (HG) (3.4.10)
Line 1:
In [[programming language theory]], a '''non-local variable''' is a variable that is not defined in the local scope.𝔻𝕆𝔼𝕊 𝔸ℕ𝕐𝕆ℕ𝔼 𝔼𝔻𝕀𝕋 𝕋ℍ𝔼𝕊𝔼 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]].
 
In [[Lua (programming language)|Lua]] they are called the ''upvalues'' of the function.<ref>''[http://www.lua.org/pil/contents.html Programming in Lua (first edition)],'' "[http://www.lua.org/pil/27.3.3.html 27.3.3 – Upvalues]"</ref>