From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:f9c3:: with SMTP id l186-v6mr19518408ith.15.1525676555416; Mon, 07 May 2018 00:02:35 -0700 (PDT) X-Received: by 2002:a9d:5511:: with SMTP id l17-v6mr2536604oth.14.1525676555080; Mon, 07 May 2018 00:02:35 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!weretis.net!feeder4.news.weretis.net!newsreader5.netcologne.de!news.netcologne.de!peer01.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!v8-v6no4004616itc.0!news-out.google.com!b185-v6ni4728itb.0!nntp.google.com!v8-v6no4004610itc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 7 May 2018 00:02:34 -0700 (PDT) In-Reply-To: <3de7cff3-9cfa-44bc-b837-5048bd813802@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=176.130.29.212; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 176.130.29.212 References: <619088663.547202536.622332.laguest-archeia.com@nntp.aioe.org> <3de7cff3-9cfa-44bc-b837-5048bd813802@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Trait based containers From: briot.emmanuel@gmail.com Injection-Date: Mon, 07 May 2018 07:02:35 +0000 Content-Type: text/plain; charset="UTF-8" X-Received-Bytes: 2259 X-Received-Body-CRC: 3687487566 Xref: reader02.eternal-september.org comp.lang.ada:52062 Date: 2018-05-07T00:02:34-07:00 List-Id: > I'm not sure either, but I hope they revert the changes to Map iterators > if they do add it to Ada202x. I'm not sure why they changed it to iterate > over the keys instead as that seems like the least useful way to iterate > over a map, and you could still access keys via the cursor. Now the less > useful way is the default. One of the main principle in the design of that library is that people could change most of the details. For instance, if you do not like the default iterator that returns a key, you can easily derive your own that returns an element instead. Initially, I had wanted to return a tuple (key, element) directly. This is really what a cursor is. So instead of doing for A of Map loop you do for C in Map.Iterate loop and you get both key and element. I prefer to return a key in the "for..of" loop case, because with a map you can always go from key->element. The opposite might not be true.