Penguin
Annotated edit history of Variable version 4, including all changes. View license author blame.
Rev Author # Line
3 AristotlePagaltzis 1 In a ProgrammingLanguage a variable is a name potentially associated with a value in the context of the SourceCode.
1 CraigBox 2
3 In the (meaningless) [C]/[C++] code:
3 AristotlePagaltzis 4 __int__ ''blarg''() {
5 __char__ ''c'' = 'a';
6 __int__ ''count'' = 12;
7 __int__ ''i'';
8 for (__int__ ''i''=0 ; ''i'' < ''count'' ; ''i''++)
9 ''c''++;
10 return (__int__) ''c'';
1 CraigBox 11 }
12
4 AristotlePagaltzis 13 c, count and i are variables. i is a variable which is initially undefined (called unbound in some languages). In [C] and [C++] function definitions are not variables, although they are in [Lisp] and [Scheme]. In pure functional programming and some contexts in other languages (like const variables in [C]/[C++]) variables cannot be changed.
1 CraigBox 14
15 Names associated with values in data (for example [HashTable]s) are not considered variables because they are not in the context of SourceCode.
16
17 See also: MetaSyntacticVariable, [Foo]