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-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,FREEMAIL_FROM, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Received: by 2002:a05:622a:306:b0:343:416d:76ae with SMTP id q6-20020a05622a030600b00343416d76aemr27314551qtw.337.1662099106234; Thu, 01 Sep 2022 23:11:46 -0700 (PDT) X-Received: by 2002:a25:2649:0:b0:696:4270:277c with SMTP id m70-20020a252649000000b006964270277cmr22557837ybm.217.1662099105991; Thu, 01 Sep 2022 23:11:45 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!border-1.nntp.ord.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 1 Sep 2022 23:11:45 -0700 (PDT) In-Reply-To: Injection-Info: google-groups.googlegroups.com; posting-host=2a01:e0a:810:89e0:2863:e1f:40fd:f3da; posting-account=6yLzewoAAABoisbSsCJH1SPMc9UrfXBH NNTP-Posting-Host: 2a01:e0a:810:89e0:2863:e1f:40fd:f3da References: <67b32db0-c4db-466c-ac13-e597e008c762n@googlegroups.com> <401d6f59-2c28-4dd5-9fa6-fccf33b6d645n@googlegroups.com> <12cc33b1-2c39-4057-8a03-623064b06e8en@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Calling inherited primitive operations in Ada From: Emmanuel Briot Injection-Date: Fri, 02 Sep 2022 06:11:46 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:64263 List-Id: > As presented, this seems very over complicated. Elements and Definite_Ele= ments=20 > add no value, and this is just a complex way of writing=20 I did point you to the full repository if you prefer an extensive, real-lif= e code sample. This was just an extract showing the gist of the issue. > One hopes that the actual library makes better use of these pkgs than thi= s small=20 > example. One can check the full code and extensive documentation on the design in th= e github repository. This is called code reuse, was invented quite a while ago. These packages are mostly implementation details. They are used to build hi= gh-level packages similar to the Ada containers, except with much better co= de reuse, more efficient, and SPARK-provable. > Ada has excellent features for hiding, but these are not among them. Assu= ming=20 And that's exactly our point in this discussion. Ada on the whole is very g= ood (we would not be using it otherwise), but it does have a number of limi= tations which are sometimes a pain, this being one of them. Not acknowledgi= ng the limitations when they exist is naive, all languages have them. > that pkg Keys serves some actual role in the spec of Maps, then someone w= anting=20 > to use pkg Maps will need to understand that role, which involves underst= anding=20 > Definite_Elements, which involves understanding pkg Traits, which involve= s=20 > understanding Elements.=20 which involves understanding Ada, which involves understanding the compiler= , which involves understanding the kernel sources, ... How many times have you checked the whole sources of the GNAT runtime to un= derstand how they implemented the Ada containers ? Emmanuel