Skip to content

Commit afb3464

Browse files
committed
Update definition of namespace.
1 parent c7f5648 commit afb3464

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

src/glossary.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,10 @@ identifiers, and labels are used to refer to an entity.
142142

143143
### Namespace
144144

145-
A [*namespace*] is a collection of uniquely named [entities](#entity).
146-
Namespaces can be organized in a hierarchy, where each level of the hierarchy
147-
has its own collection of named entities.
145+
A [*namespace*] is a set of [names](#name) where each name unambiguously
146+
refers to a specific [entity](#entity). Namespaces are organized in a
147+
hierarchy, where each level of the hierarchy has its own collection of named
148+
entities.
148149

149150
### Nominal types
150151

src/names/namespaces.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Namespaces
22

3-
Entity names are segregated into separate *namespaces* based on the kind of
4-
entity that declared the name. The usage of a name will look for the
5-
declaration of that name in different namespaces, based on the context, as
6-
described in the [name resolution] chapter.
3+
A *namespace* is a set of [names] where each name unambiguously refers to a
4+
specific [entity]. Namespaces are organized in a hierarchy, where each level
5+
of the hierarchy has its own collection of named entities.
6+
7+
There are several different namespaces that each contain different kinds of
8+
entities. The usage of a name will look for the declaration of that name in
9+
different namespaces, based on the context, as described in the [name
10+
resolution] chapter.
711

812
The following is a list of namespaces, with their corresponding entities:
913

@@ -121,6 +125,7 @@ imported.
121125
[Constant item declarations]: ../items/constant-items.md
122126
[Derive macro helpers]: ../procedural-macros.md#derive-macro-helper-attributes
123127
[Derive macros]: ../procedural-macros.md#derive-macros
128+
[entity]: ../glossary.md#entity
124129
[Enum variant constructors]: ../items/enumerations.md
125130
[enum]: ../items/enumerations.md
126131
[External crate declarations]: ../items/extern-crates.md
@@ -135,6 +140,7 @@ imported.
135140
[Loop labels]: ../expressions/loop-expr.md#loop-labels
136141
[Module declarations]: ../items/modules.md
137142
[name resolution]: name-resolution.md
143+
[names]: ../names.md
138144
[numeric]: ../types/numeric.md
139145
[Static item declarations]: ../items/static-items.md
140146
[Struct constructors]: ../items/structs.md

0 commit comments

Comments
 (0)