From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed2-a.proxad.net!nnrp2-1.free.fr!not-for-mail From: Thomas Newsgroups: comp.lang.ada Mail-Copies-To: nobody Subject: Re: array from static predicate on enumerated type References: <89128f73-fcc5-4e57-8067-d09877ba0211n@googlegroups.com> <6ca041f3-2669-4497-9548-2f17666702a6n@googlegroups.com> <26c44e00-a899-455a-a929-1e23c7935fe3n@googlegroups.com> <9abb081d-a323-466d-9ae8-a2fc8fa24725n@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Date: Wed, 16 Mar 2022 01:38:41 +0100 Message-ID: Organization: Guest of ProXad - France NNTP-Posting-Date: 16 Mar 2022 01:38:41 CET NNTP-Posting-Host: 91.175.52.121 X-Trace: 1647391121 news-1.free.fr 29490 91.175.52.121:4334 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:63608 List-Id: In article , "Dmitry A. Kazakov" wrote: > 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. i don't understand, since Ada.Containers.Ordered_Maps.Key_Type is private, and so new Ada.Containers.Ordered_Maps (CURVED_LETTERS, Integer) is allowed. -- RAPID maintainer http://savannah.nongnu.org/projects/rapid/