comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: interfaces and limited/controlled/limited-controlled types
Date: Sat, 27 Jan 2018 01:12:42 -0600
Date: 2018-01-27T01:12:42-06:00	[thread overview]
Message-ID: <p4h8pb$cui$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: p4f2oa$c4u$1@dont-email.me

"Alejandro R. Mosteo" <alejandro@mosteo.com> 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 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.


  reply	other threads:[~2018-01-27  7:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25 16:21 interfaces and limited/controlled/limited-controlled types Mehdi Saada
2018-01-25 22:00 ` Robert Eachus
2018-01-26  4:58 ` Randy Brukardt
2018-01-26  8:28   ` Dmitry A. Kazakov
2018-01-26 11:17     ` Alejandro R. Mosteo
2018-01-27  7:12       ` Randy Brukardt [this message]
2018-01-27 14:04         ` Jere
2018-01-27 14:38           ` Dmitry A. Kazakov
2018-01-27 18:28             ` Jere
2018-01-29 23:05               ` Randy Brukardt
2018-01-29 23:03             ` Randy Brukardt
2018-01-31 11:54         ` Alejandro R. Mosteo
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox