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:a37:54f:0:b0:6ba:5369:5c5a with SMTP id 76-20020a37054f000000b006ba53695c5amr20278329qkf.253.1662058441550; Thu, 01 Sep 2022 11:54:01 -0700 (PDT) X-Received: by 2002:a25:42c6:0:b0:696:1721:d3a with SMTP id p189-20020a2542c6000000b0069617210d3amr19098626yba.28.1662058441285; Thu, 01 Sep 2022 11:54:01 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!usenet.blueworldhosting.com!feed1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.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 11:54:00 -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: Thu, 01 Sep 2022 18:54:01 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3051 Xref: reader01.eternal-september.org comp.lang.ada:64261 List-Id: I think I have a more interesting example. This one is extracted from my at= tempted traits containers, for which I had published a blog post at AdaCore= . My enhanced fork of the library is at=20 https://github.com/briot/ada-traits-containers if someone wants to experiment with non-trivial generics code (and containe= rs are of course a case where generics fully make sense). Here is the example: generic type Element_Type is private; type Stored_Type is private; package Elements is end Elements; with Elements; generic type Element_Type is private; package Definite_Elements is package Traits is new Elements (Element_Type, Stored_Type =3D> Element_T= ype); end Definite_Elements; with Definite_Elements; generic type Key_Type is private; package Maps is package Keys is new Definite_Elements (Key_Type); function "=3D" (L, R : Keys.Traits.Stored_Type) return Boolean -- "S= tored_Type" is not a visible entity of "Traits" is (False); end Maps; This is not case where the actual is visible unless I happen to know how De= finite_Element is implemented and that it will use Element_Type for Stored_= Type (and this is not a knowledge I wish client packages to have, the whole= point of Element and Definite_Element is to basically hide how elements ca= n be stored in a container, and whether we need memory allocation for insta= nce).