In comp.std.c David Hopwood said:
Variables may or may not be capable of being modified, depending on
the programming language. The term "variable" does not in itself connote
modifiability.
I've not taught a course on principles of programming languages for
almost ten years, but the last time I looked at textbooks on the
subject, none of the used the term object in the sense that it is used
by the C and C++ standards. Rather, they defined a variable to
consist of some or all of the following:
- a name (in the sense of identifer)
- a memory location capable of holding a value (i.e., what C/C++
calls an object)
- a scope
- a lifetime
- a type.
Somewhere they implicitly or explicity spoke of anonymous (nameless)
variables, often with statements like "an array is a sequence of
variables indexed by a range of integers" -- visibly each of them
doesn't get its own name. So, what's a variable without a name? It
looks very much like what C/C++ calls an object.
I'm not saying that I prefer that terminology, but it's important and
often difficult to translate among the metalanguages for various
programming languages. Too often the same idea arises in multiple
computing contexts, each time with an different metaphoric
terminology.
Tom Payne