Julie said:
Keith said:
This is posted only to comp.lang.c++, which I don't regularly follow.
Julie said:
Ioannis Vranos wrote: [...]
The C++ standard says: [...]
"A variable is introduced by the declaration of an object. The
variable's name denotes the object."
Fine -- but what that is saying is that when you create an
object, you also introduce a variable. The opposite is not
necessarily true: introducing a variable does *NOT* imply the
declaration of an object.
The first occurence of "variable" in the above quotation from the
standard is in italics. That means it's the definition of the word
"variable", which implies that it's exclusive, i.e., that anything not
introduced by the declaration of an object is not a variable.
You may want to research predicate logic.
When a word is being formally defined, different rules apply.
In most contexts, the statement that
A variable is introduced by the declaration of an object.
would leave open the possibility that variables could be introduced by
other means. But since the word "variable" is in italics, the above
sentence is intended to be a definition. If a variable can be
introduced by means other than the declaration of an object, I'd say
it's a very poor definition.
Then again, C++ 1.3p2 says:
Terms that are used only in a small portion of this International
Standard are defined where they are used and italicized where they
are defined.
The term "variable" isn't used "only in a small portion" of the
standard. Perhaps the quoted sentence isn't intended to be a
definition (but then I can't imagine why "variable" is in italics).
Perhaps this is a question for comp.std.c++.
[...]
Again, this discussion doesn't have to limit itself to what is or is
not included in any standard. This discussion is about languages,
in a forum about languages (comp.lang.c*), as defined about
standards. Variable discussions in comp.std.c may be inappropriate,
here in comp.lang.c, it is perfectly appropriate -- I've re-added
the newsgroup to this reply.
This sub-branch of the discussion is specifically about the C++
standard's definition of the word "variable"; it's off topic in
comp.lang.c.