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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.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: T'Interface attribute Date: Mon, 7 Aug 2017 17:59:36 -0500 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Mon, 7 Aug 2017 22:59:38 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="28346"; 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: news.eternal-september.org comp.lang.ada:47638 Date: 2017-08-07T17:59:36-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:om3ta9$fnc$1@gioia.aioe.org... ... > There is nothing wrong with additive inheritance. The same interface when > added twice once publicly once privately could simply allocate new slots. We tried that. But... >... In all contexts where both become visible must require explicit name >resolution, e.g. by renaming one of the types and/or primitive operations. Ada doesn't have type renaming, so this is not possible in general. And having calls be illegal in such cases is a massive problem in generic bodies. Typical assume-the-worst rules would have to make calling any interface related to a formal illegal in a generic body. It was a massive can of worms. The alternative approach (the interface is the same) breaks privacy pretty badly. We essentially gave up, and more recent attempts to allow a limited set of "hidable interfaces" didn't fare any better. ... ... >> I've generally materialized that as "the root of an abstraction should >> always be declared abstract". > > Yes, but this is not enough, because it kills potential > multiple-inheritance cases. As an implementer, knowing that multiple-inheritance is just barely possible to implement, I'm unwilling to consider that unless no other possibility exists. And some other way always exists. :-) >> In Claw, the only places that we got much benefit from OOP (beyond >> dispatching callbacks, the reason we used OOP in the first place) was in >> sharing implementations across related types. But that doesn't work for >> Ada >> interfaces, because you can't have any components in the type -- meaning >> that writing real implementations is impossible. One can use abstract >> types >> in this way (and we did so extensively). > > Reuse happens on the client's side, when you share interface-wide > implementations. This includes helper types which refer to [access] > I'Class. Surely you have lots of them to pass widgets around, in events, > in handlers etc. Not really. The implementation has such things, but we only exposed parameters of Root_Window_Type'Class (with a couple of exceptions). The vast majority of routines only take a single object. The other hierarchies (canvas, menus, etc.) work similarly. Randy.