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!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: interfaces and limited/controlled/limited-controlled types Date: Wed, 31 Jan 2018 12:54:46 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 31 Jan 2018 11:54:46 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="2f20b8b97fafce3f66bd673d6463738f"; logging-data="15227"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+fW8F5iDX/IB2HuuvoHGwR" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:7ja9RRbqhzVwRdrd5uofGHIOODo= Xref: reader02.eternal-september.org comp.lang.ada:50223 Date: 2018-01-31T12:54:46+01:00 List-Id: On 27/01/18 08:12, Randy Brukardt wrote: > "Alejandro R. Mosteo" wrote in message > news:p4f2oa$c4u$1@dont-email.me... > ... >> I just was lamenting myself recently for not recalling this idea for the >> next revision. Just add new interfaces with the same semantics. > > That would probably work for Root_Storage_Pool and Root_Streams as these > generally don't have any associated implementation. > > For controlled, however, a common implementation strategy is to build the > overhead into the root type (the chaining components that are common to all > controlled object). Interfaces can't have components, and the work to allow > that in this one case is roughly equivalent to allowing all interfaces to > have components (which of course is full multiple inheritance -- which would > make Dmitry happy :-). I don't see any point in doing a massive amount of > work inside the compiler and not letting users have access to it. So it > essentially is full MI or bust here (and I personally vote for bust :-). I understand now, thanks. I had considered the user side POV only, thinking that some "compiler magic" would be involved, but certainly didn't suspect it would be so big a change. Thanks, Alex. > >> I wonder if there are technical problems besides having a duplicated >> feature. > > If there is any concrete implementation associated with the root type, then > an interface is not a useful replacement. You would need multiple > inheritance to work for abstract types (in which case interfaces are a junk > redundant feature). Most likely, existing vendors would just forget about > upgrading their compilers (that seems to be the case for some vendors > anyway, wouldn't want to make it a perfect sweep :-). > > Randy. > >