comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: changing rules for anonymous access types to named ones
Date: Tue, 3 Apr 2018 14:44:33 +0200
Date: 2018-04-03T14:44:33+02:00	[thread overview]
Message-ID: <p9vsvg$1tui$1@gioia.aioe.org> (raw)
In-Reply-To: 8611490c-13be-41fe-a5ef-9403bb196bbf@googlegroups.com

On 03/04/2018 13:29, Jean-Claude Rostaing wrote:
>>      type My_Custom_Integer is new Integer'Interface with record
>>         -- Whatever I see appropriate to represent integer
>>      end record;
>>      -- overriding all operations, since they are inherited abstract
> If you want a view conversion INTEGER(any_type_inheriting_INTEGER'Interface) to works,

That is an upcast conversion since Integer'Interface'Class is not in 
Integer'Class.

> you should also inheriting also all attributes of Integer, or of any numeric type which providing the interface ?

Yes. All object attributes should have been primitive operations. Type 
attributes are free operations.

> But I suppose your model could work if you were to limit 'Interface to tagged types, records tasks and protected types.

For by-value types conversion T -> T'Class is a full conversion.

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

      reply	other threads:[~2018-04-03 12:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 16:39 changing rules for anonymous access types to named ones Jean-Claude Rostaing
2018-04-02 18:04 ` Jere
2018-04-02 21:09   ` Jean-Claude Rostaing
2018-04-03  8:41     ` Dmitry A. Kazakov
2018-04-03 11:29       ` Jean-Claude Rostaing
2018-04-03 12:44         ` Dmitry A. Kazakov [this message]
replies disabled

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