From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Controlled types as interfaces
Date: Wed, 20 Aug 2014 15:47:56 +0200
Date: 2014-08-20T15:47:56+02:00 [thread overview]
Message-ID: <imjh3cg11wdr$.1hslpo3a68yxi.dlg@40tude.net> (raw)
In-Reply-To: lt25h5$m32$1@speranza.aioe.org
On Wed, 20 Aug 2014 15:49:36 +0300, Victor Porton wrote:
> Dmitry A. Kazakov wrote:
>
>> On Wed, 20 Aug 2014 04:09:15 +0300, Victor Porton wrote:
>>
>>> Victor Porton wrote:
>>>> I think in Ada 202X we can invent Limited_Controlled_Interface and
>>>> Controlled_Interface types derived from which could become controlled.
>>
>> Yes, but that would be very complicated, because you could add an
>> interface very late, making a descendant of a non-controlled type
>> controlled.
>>
>> A better solution would be fixing initialization (AKA constructors) and
>> leaving controlled kludge as is.
>
> I don't see any reason not to make descendant of a non-controlled type
> controlled.
I don't see why any type cannot have initialization hooks either.
> Let T is a non-controlled tagged type.
>
> It descendant Q is like a record
>
> record
> Old: T;
> Ext: Q1;
> end record;
>
> (where Q1 is the difference of Q and T).
>
> Q1 is controlled.
>
> As there is no problem that this record becomes controlled, there are no
> reason not to make Q controlled despite of T was non-controlled.
It depends on concrete implementations, e.g. some might require the type
tag being at the record's first address.
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2014-08-20 13:47 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-20 1:05 Controlled types as interfaces Victor Porton
2014-08-20 1:09 ` Victor Porton
2014-08-20 7:29 ` Dmitry A. Kazakov
2014-08-20 12:49 ` Victor Porton
2014-08-20 13:47 ` Dmitry A. Kazakov [this message]
2014-08-21 23:16 ` Randy Brukardt
2014-08-29 15:01 ` Robert A Duff
2014-08-29 23:54 ` Randy Brukardt
2014-08-20 12:50 ` Victor Porton
2014-08-20 13:38 ` Dmitry A. Kazakov
2014-08-20 13:56 ` Brad Moore
2014-08-21 22:48 ` Randy Brukardt
2014-08-20 1:41 ` Victor Porton
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox