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: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Controlled types as interfaces Date: Thu, 21 Aug 2014 17:48:53 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <17zg1do470nci.15209dgoz3ktk.dlg@40tude.net> <1O1Jv.11735$8G3.5145@fx12.iad> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1408661336 15429 69.95.181.76 (21 Aug 2014 22:48:56 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 21 Aug 2014 22:48:56 +0000 (UTC) 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.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:188593 Date: 2014-08-21T17:48:53-05:00 List-Id: "Brad Moore" wrote in message news:1O1Jv.11735$8G3.5145@fx12.iad... > On 14-08-20 06:50 AM, Victor Porton wrote: ... > The incompatibilities are described in the discussion section of the AI, > but these had to do with problems of changing Root_Stream_Type into an > interface. > > However, I believe you are correct that if we modified Root_Stream_Type to > remain an abstract type that inherits from a Root_Stream_Interface, then > these incompatibilities would not exist. No, sorry, they're the same. The problem is that Ada doesn't allow hidden inheritance (in any way) of an interface. If Root_Stream_Type is an interface, or inherits from an interface, then it cannot be used in the full type definition of a private type. That's the backwards incompatibility. > Backward incompatibilities are to be avoided if at all possible, so I > think if we were to go forward with this AI, your suggestion to make > Root_Stream_Type inherit from a Root_Stream_Interface, might be the way to > go. We've already discussed that as-nausem. My personal opinion (in the case of Root_Stream_Type) is that there isn't any good reason to use this in a hidden way, so we could just make it an interface and swallow the incompatibility. (When I suggested that at a meeting, though, it got no traction.) But that's not true for Controlled. The vast majority of the types I define are tagged private where the full type is derived from Controlled (or Limited_Controlled). The most recent versions of AI12-0023-1 were trying to find ways to lift the ban against hidden interfaces for a restricted set of interfaces. It's the only way to do this without incompatibilities for existing uses. My recollection is that it wasn't going well (but we haven't worked on that since the Stockholm meeting more than a year ago). Randy.