Skip to content

Commit 4a241b2

Browse files
committed
Define what a collection is and integrate feedback
1 parent df0d201 commit 4a241b2

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

spec/Appendix A -- Notation Conventions.md

+22-18
Original file line numberDiff line numberDiff line change
@@ -219,31 +219,35 @@ implementations.
219219

220220
## Data Collections
221221

222-
This specification describes the semantic properties of data collections using
223-
types like "list", "set" and "map". These describe observable data collections
224-
such as the result of applying a grammar and the inputs and outputs of
225-
algorithms. They also describe unobservable data collections such as temporary
226-
data internal to an algorithm. Each data collection type defines the operations
227-
available, and whether values are unique or ordered.
222+
A data collection is a finite, iterable aggregation of elements whose iteration
223+
order is not necessarily stable. This specification describes the semantic
224+
properties of data collections using types like "list", "set" and "map". These
225+
describe observable data collections, such as the result of applying a grammar
226+
and the inputs and outputs of algorithms. They also describe unobservable data
227+
collections such as temporary data internal to an algorithm. Each data
228+
collection type defines the operations available, and whether values are unique
229+
or ordered.
228230

229231
**List**
230232

231-
:: The term _list_ describes a sequence of values which may not be unique. A
232-
list is ordered unless explicitly stated otherwise (as an "unordered list"). For
233-
clarity the term "ordered list" may be used when an order is semantically
233+
:: The term _list_ describes a sequence of zero or more values, which may
234+
contain duplicates. Currently, all lists in this specification are ordered, but
235+
for clarity the term "ordered list" may be used when an order is semantically
234236
important.
235237

236238
**Set**
237239

238-
:: The term _set_ describes a unique collection of values, where each value is
239-
considered a "member" of that set. A set is unordered unless explicitly stated
240-
otherwise (as an "ordered set"). For clarity the term "unordered set" may be
241-
used when the lack of an order is semantically important.
240+
:: The term _set_ describes a collection of zero or more values, which may not
241+
contain duplicates. Each value is considered a "member" of the set. A set is
242+
unordered unless explicitly stated otherwise (as an "ordered set"). For clarity,
243+
the term "unordered set" may be used when the lack of an order is semantically
244+
important.
242245

243246
**Map**
244247

245-
:: The term _map_ describes a collection of "entry" key and value pairs, where
246-
the set of keys across all entries is unique but the values across all entries
247-
may repeat. A map is unordered unless explicitly stated otherwise (as an
248-
"ordered map"). For clarity the term "unordered map" may be used when the lack
249-
of an order is semantically important.
248+
:: The term _map_ describes a collection where each element is a pair (called an
249+
"entry") consisting of a key and a value. Keys are unique: no two entries with
250+
the same key may exist in the same map, but values may repeat. A map is
251+
unordered unless explicitly stated otherwise (as an "ordered map"). For clarity,
252+
the term "unordered map" may be used when the lack of an order is semantically
253+
important.

0 commit comments

Comments
 (0)