comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: interfaces and limited/controlled/limited-controlled types
Date: Fri, 26 Jan 2018 09:28:10 +0100
Date: 2018-01-26T09:28:10+01:00	[thread overview]
Message-ID: <p4eoqq$1l2v$1@gioia.aioe.org> (raw)
In-Reply-To: p4eci9$ao7$1@franka.jacob-sparre.dk

On 26/01/2018 05:58, Randy Brukardt wrote:
> "Mehdi Saada" <00120260a@gmail.com> wrote in message
> news:ea190839-2f83-4dbb-9064-8d6f535cc1d0@googlegroups.com...
>> Is it only because of history and compatibility issues, that
>> Limited_Controlled and Controlled aren't rewrote as interfaces ?
>> Like: T_type is limited new Ancestor_type with Controlled
>> or T_type is new Ancestor_type with Limited_Controlled
>>
>> Or is there a semantic issue too ?
> 
> A compatibility issue IS a semantic issue! Yes, the main reason is
> compatibilty. We've looked at ways to allow Root_Streams_Type to be an
> interface (same problem), and the levels of semantic trouble that occurs
> makes it a dubious proposition (at least so far).

Stream and pool interfaces are simpler I suppose than having a 
controlled interface. However having an ability to add finalization 
later would be an indispensable feature. Existing workarounds are not 
good at all.

BTW, was it considered to add new interfaces without making existing 
base types members of? It would not look clean but it would be 100% 
compatible:

    type <anonymous> is interface;
    procedure Initialize (Object : in out <anonymous>) is abstract;
    procedure Adjust     (Object : in out <anonymous>) is abstract;
    procedure Finalize   (Object : in out <anonymous>) is abstract;

    type Controlled is abstract new <anonymous> with private;
    overriding procedure Initialize (Object : in out Controlled) is null;
    overriding procedure Adjust     (Object : in out Controlled) is null;
    overriding procedure Finalize   (Object : in out Controlled) is null;

    type Controlled_Interface is new <anonymous>;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de


  reply	other threads:[~2018-01-26  8:28 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 [this message]
2018-01-26 11:17     ` Alejandro R. Mosteo
2018-01-27  7:12       ` Randy Brukardt
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