From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Simple example on interfaces Date: Tue, 26 Jan 2021 21:09:57 -0600 Organization: JSA Research & Innovation Message-ID: References: <9e1b5d67-be08-4f53-aadc-fbed761a8c24n@googlegroups.com> <6e343937-3590-4944-8c38-10b61014e128n@googlegroups.com> Injection-Date: Wed, 27 Jan 2021 03:09:58 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="27999"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:61217 List-Id: "Dmitry A. Kazakov" wrote in message news:ruprf8$1h6q$1@gioia.aioe.org... ... >> universal_integer is anonymous and doesn't have any operations (except >> automatic conversion). > > Yes. In a never ending discussion with Randy I insist that this stuff > should be made explicit, available for any types. As I've often said, for a new language that would certainly be a good idea. For Ada, reproducing all of the quirks of Ada would lead to an inpentrable mess. And not reproducing them would break a lot of code (and more importantly, no one could tell if their code would be broken and in extreme cases, wouldn't even know as the code would silently change meaning). As far as full multiple inheritance being too expensive to implement, I tend to think that is true for interfaces as well. :-) As always, the question is whether one wants fast code or just something that works. Full multiple inheritance certainly can be implemented by converting all selectors to Getter/Setter pairs and dispatching on every use. But that's pretty expensive for accessing an integer component. Of course, most of the time it won't matter (Janus/Ada does something like this for shared generics, and I have yet to have someone complain about performance of generic code). But there will be cases where it does matter, and this is a distributed overhead -- it applies to all types whether or not you use it (because someone could extend this type in some future unit not even written yet). Randy.