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:6fd1:: with SMTP id x200mr5972119itb.26.1546768449279; Sun, 06 Jan 2019 01:54:09 -0800 (PST) X-Received: by 2002:aca:308d:: with SMTP id w135mr718230oiw.0.1546767248806; Sun, 06 Jan 2019 01:34:08 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!goblin1!goblin.stu.neva.ru!k10no527066itk.0!news-out.google.com!v71ni514ita.0!nntp.google.com!q69no525620itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 6 Jan 2019 01:34:08 -0800 (PST) In-Reply-To: <9179093f-4765-47a9-9dc6-147c9d7d6c56@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=85.168.19.89; posting-account=O_NgcgoAAABs6pgCjroQBmOBL5ZZGPUc NNTP-Posting-Host: 85.168.19.89 References: <2a6929c5-72fa-4d84-953a-44ea4597ab38@googlegroups.com> <9e6b4219-d6ba-4c89-814d-5ea6e48ed8ea@googlegroups.com> <9179093f-4765-47a9-9dc6-147c9d7d6c56@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: class wide iterable (and indexable) From: George Shapovalov Injection-Date: Sun, 06 Jan 2019 09:54:09 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:55211 Date: 2019-01-06T01:34:08-08:00 List-Id: > > You can using a Mixin Generic along with the interface. Consider the > > following example: > > >=20 > And if you don't like the Mixin method, you can do something a bit closer= to > composition and Rust's model=20 Thank you! Yes, this does the job done (and I believe the 1st one was what Dmitry alre= ady have shown above), achieving the effect of in-mixing overridable method= s. However allowing interfaces to have non0bull or abstract primitives (obv= iously referencing onyl existing entities, just like class-wide methods do = already anyway) would have been much less cumbersome and much more elegant = and readable to begin with.. But this was just a sidenote to that discussion. My original intention was = to attempt to move the existing type (that would serve as a top of type hie= rarchy normally) to the side of a new type tree - which is not that "topolo= gically different" from the mix-in equiliristic, just a bit different way t= o glue things together. The complicating circumstance in that specific case= (which prompted my original post) was to provide indexing/iteration to the= entire type tree and then glue Ada.Containers.Vectors right over it, which= finally succeeded after more digging through aspects and Ada standard libr= ary internals. Tanks to everybody for informative comments!