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.
|Location:||Huddersfield, West Yorkshire, UK|
|Nodes:||16 (2 / 14)|