On 2021-03-15 18:48, Shark8 wrote:
So, in Ada, there's no good choice for how to actually DO an array with gaps in the index:
That applies to all containers. The problem is mapping the key to a
dense position when the key is not dense or might be unordered.
There is no gaps in positions.
But Array *isn't* a map, though often it is substituted as one.
Of course it is, per definition of mapping. f : key -> element.
Array has further constraints, like the contiguous memory labeled above.
No. The constraint here is a dense index. That is not specific to a
general map or an array. It is a fundamental property of the set of keys being a convex set. Convex ensures certain useful mathematical
properties invariant to the representation of the mapping. In
particular, it gives a way to enumerate elements.
Arbitrary predicate kills convex, so the problem. Not array. A map would
have just same problem: a map of LETTERS is in general not substitutable
for a map of CURVED_LETTERS.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 335 |
Nodes: | 16 (2 / 14) |
Uptime: | 148:21:44 |
Calls: | 7,411 |
Calls today: | 1 |
Files: | 12,670 |
Messages: | 5,613,100 |