comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: How to pass around access types to interfaces?
Date: Sun, 26 Oct 2008 09:02:51 +0100
Date: 2008-10-26T09:02:51+01:00	[thread overview]
Message-ID: <il41wscr7m2r.1ud5r5ac3loby.dlg@40tude.net> (raw)
In-Reply-To: wccej24uxsi.fsf@shell01.TheWorld.com

On Sat, 25 Oct 2008 18:15:09 -0400, Robert A Duff wrote:

> "Martin Krischik" <krischik@users.sourceforge.net> writes:
> 
>> Am 24.10.2008, 13:45 Uhr, schrieb Sven <sven.weidauer@gmail.com>:
>>
>>>   type My_Interface_Access is access all My_Interface'Class;
>>
>> Do you realy need an access type? Read:
>>
>> http://en.wikibooks.org/wiki/Ada_Programming/Object_Orientation#The_class-wide_type
>>
>> If so, does it need to be an access all? Read:
> 
> In my experience, access-to-class-wide types almost always need to have
> "all", because you often want to convert from access-to-T2 up to
> access-to-T1'Class (where T2 is a descendant of T1).

It would be nice if that were finally fixed! [*]

But, in general it is better to use only access to class-wide. So the cases
where access to T2 is converted to access to T1 are suspicious to me. When
that happens I readily use Unchecked_Conversion, since it is already
broken.

--------
*  Similar issue: there is no good way to obtain a pool-specific access
type from Finalize.

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



  reply	other threads:[~2008-10-26  8:02 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-24 11:45 How to pass around access types to interfaces? Sven
2008-10-24 12:24 ` Niklas Holsti
2008-10-24 12:49   ` Sven
2008-10-24 13:55     ` Ludovic Brenta
2008-10-24 21:32 ` sjw
2008-10-25  8:54   ` Sven
2008-10-25 15:43 ` Martin Krischik
2008-10-25 22:15   ` Robert A Duff
2008-10-26  8:02     ` Dmitry A. Kazakov [this message]
2008-10-26 15:50     ` Martin Krischik
2008-10-28 13:41       ` Maciej Sobczak
2008-10-29 14:15         ` Martin Krischik
2008-10-31 13:38           ` Maciej Sobczak
2008-10-31 14:46             ` Dmitry A. Kazakov
2008-10-29 12:42   ` Sven
2008-10-29 13:17     ` Dmitry A. Kazakov
replies disabled

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