Differences between current version and revision by previous author of Variable.
Other diffs: Previous Major Revision, Previous Revision, or view the Annotated Edit History
Newer page: | version 4 | Last edited on Sunday, March 7, 2004 9:28:13 am | by AristotlePagaltzis | |
Older page: | version 1 | Last edited on Monday, October 13, 2003 7:10:40 pm | by CraigBox | Revert |
@@ -1,17 +1,17 @@
-In ProgrammingLanguages
a variable is a name potentially associated with a value in the context of the SourceCode.
+In a ProgrammingLanguage
a variable is a name potentially associated with a value in the context of the SourceCode.
In the (meaningless) [C]/[C++] code:
- int blarg() {
- char c = 'a';
- int count = 12;
- int i;
- for (int i=;i<count;i++)
- c++;
- return (int) c;
+ __
int__ ''
blarg''
() {
+ __
char__ ''
c''
= 'a';
+ __
int__ ''
count''
= 12;
+ __
int__ ''
i''
;
+ for (__
int__ ''
i''
=0 ; ''
i''
< ''
count''
; ''
i''
++)
+ ''
c''
++;
+ return (__
int__
) ''
c''
;
}
-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 some langauges (including all
pure FunctionalLanguages) variables
and in
some contexts (const variables in [C]/[C++]) variables cannot be changed.
+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.
Names associated with values in data (for example [HashTable]s) are not considered variables because they are not in the context of SourceCode.
See also: MetaSyntacticVariable, [Foo]