From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,100eb0a59892e906 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!nx02.iad.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: How to pass around access types to interfaces? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: Date: Sun, 26 Oct 2008 09:02:51 +0100 Message-ID: NNTP-Posting-Date: 26 Oct 2008 09:02:51 CET NNTP-Posting-Host: 83332527.newsspool2.arcor-online.net X-Trace: DXC=m`?9EmQReaj9kIfcjg:0fdA9EHlD;3Ycb4Fo<]lROoRa4nDHegD_]Rej0Cc=GPDG2dDNcfSJ;bb[eIRnRBaCd On Sat, 25 Oct 2008 18:15:09 -0400, Robert A Duff wrote: > "Martin Krischik" writes: > >> Am 24.10.2008, 13:45 Uhr, schrieb Sven : >> >>> 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