Upvalues
Part of speech: noun
Definitions
- Variables from an enclosing function scope that are referenced by a nested function or closure in programming; data elements captured from an outer context by inner functions or coroutines ; identifiers retained from a higher-level environment for later use in code execution
- Refers to symbols or variables from an outer or parent context accessed and utilized within a local or child function in certain programming languages ; values preserved from a broader scope by functions or closures ; elements imported from external scopes for ongoing reference in executed routines
- Describes programming values or variables taken from an exterior function scope and employed inside a more localized scope, such as within closures or nested routines ; context-specific data captured from their original environment when a function is defined ; outer-scope identifiers made available for inner code manipulation
Etymology: The term originates from the realm of computer programming, particularly in the context of the Lua programming language. It entered technical jargon in the late 20th century as programming languages began to support more advanced features like closures and first-class functions. "Upvalues" refer specifically to variables that are defined in an outer function but accessed within an inner function, allowing the inner function to "close over" these variables and retain their state even after the outer function has completed execution. This concept is a key aspect of closures, a feature that enables functions to carry their environment with them, preserving access to variables beyond their normal scope. The word itself is a compound formed from "up," suggesting something elevated or from an outer scope, combined with "value," indicating a stored piece of data. Together, they express the idea of a value lifted from an enclosing context into an inner one. The notion of capturing external variables in inner functions has roots in earlier programming languages like Scheme and Lisp, where closures were first formalized. However, the specific term gained prominence with Lua, which uses "upvalues" explicitly in its official documentation to describe these captured variables. This naming highlights the hierarchical relationship of scopes in programming, where an inner function reaches "up" to an outer function's environment. While "upvalue" remains mostly confined to programming lexicon, its formation follows a common English pattern of combining a directional prefix with a noun to create a new technical term. This illustrates how language evolves within specialized fields, adapting existing words to describe novel concepts with precision and clarity.
Synonyms: outer variables, enclosing variables, captured variables, free variables, lexical variables