local variable


Also found in: Dictionary, Thesaurus, Medical, Legal, Financial, Acronyms, Wikipedia.

local variable

[′lō·kəl ′ver·ē·ə·bəl]
(computer science)
A variable which can be accessed (used or changed) only in one block of a computer program.

local variable

(programming)
A variable with lexical scope, i.e. one which only exists in some particular part of the source code, typically within a block or a function or procedure body. This contrasts with a global variable, which is defined throughout the whole program.

Code is easier to understand when the scope of variables is as small as possible because it is easier to see how the variable is set and used. Code containing global variables is harder to modify because they create more interdependencies between sections of code.

local variable

In programming, a variable used only within the routine or function it is defined in. When the function is finished and control is returned back to the part of the program that called it, the local variables no longer exist. Contrast with global variable.
References in periodicals archive ?
--ret x: jumps to an address stored in local variable x.
The function object passed to MAPCAR contains a reference to the LET body's local variable, AVG.
where b denotes a Boolean expression and all Boolean operators are supported, R ([R.sub.1], [R.sub.2]) denotes a sequence, P ([P.sub.1], [P.sub.2]) denotes a property, v denotes a local variable name, and e denotes an expression.
This method flame contains the values of parameters and local variables as well as information about the caller.
By Lemma 4.3, [G'.sub.s] [equivalent] [Gamma]([G'.sub.r]) where [Gamma] is the the local variable correcting renaming for [tree.sub.P](<[g.sub.2], [c.sub.1]>) and [tree.sub.P] (<[g.sub.2], c>).
This is because all control transfers in CPS are realized as function calls; at any program point, a local variable that is no longer live cannot be free in the current continuation, and vice versa.
f[y] :[F.sub.pc][y] requires that the local variable contents match the types in F.
When considering a small open economy, such as the Colombian one, it is desirable to impose restrictions on the impact that local variables could have on global ones (block exogeneity).
Values measured by the transducers and local variable values follow in a predefined order; for the sake of readability we use a made-up variable name (sensorMeasurements) to stand for Voltage, EnvLight, Nighttime, PresenceStable, Presence, and LightLamp.
The property declaration syntax with a local variable can be illustrated as follows:
The building air-handling units reset the supply air temperature based on building load, while local variable air volume terminal units modulate airflow rates for temperature control.

Full browser ?