Liste des Groupes | Revenir à cl c |
On 12.12.2024 20:39, James Kuyper wrote:...On 12/12/24 00:07, Janis Papanagnou wrote:
>Personally I'd colloquially take both those terms as the same thing,>
but I'm not a native speaker.
They are not.
The C standard does not define the term "name space", relying instead
upon the general CS definition of the term. However, it has a whole
section (6.2.3) devoted to listing and explaining the name spaces that
are relevant to the C language.
>
In C++, "namespace" is a both a keyword (listed in 5.11p3) and a piece
of terminology (defined in 9.8p1) for the feature enabled by that
keyword. It is clear from those descriptions that a C++ namespace is
significantly different thing from a C name space.
Unlike the C standard, the C++ standard doesn't even bother explaining
name spaces. It makes only two uses of that term on it's own behalf, in
connection with statement labels and macro names - neither usage has any
plausible connection with a namespace. There are several occurrences of
"name space" in the section describing the differences between C and
C++, which make it clear that both standards are using the same meaning
for "name space", but that the two languages have a different number of
name spaces, with different contents.
You seem to be speaking about terms in different standards while
I spoke about "colloquially", the meaning of an expression named
"name space", or "name-space", or "namespace" (whatever is the
correct writing in English would be; note my hint about native
speakers). - So, now, have we two been speaking cross-purpose?
Note that Scott in his post wrote
>
In C++ they reside in the ordinary name space only if they're not
part of a named namespace.
>
which I interpreted as
>
In C++ they reside in the ordinary "name space" only if they're not
part of a named 'namespace'.
>
where "name space" would be the [colloquial] name of the concept
behind the symbol 'namespace'.
>
My interpretation of his post was that he wanted to differentiate
the default 'namespace' from the "named 'namespace'". (And that
the three types of "Name Spaces" (that you had in mind) were not
his concern with his remark.)
Les messages affichés proviennent d'usenet.