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,c08a7609345f4e5 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!newsfeed.straub-nv.de!news-1.dfn.de!news.dfn.de!news.uni-weimar.de!not-for-mail From: stefan-lucks@see-the.signature Newsgroups: comp.lang.ada Subject: Re: Limited use for limited with? Date: Tue, 28 Sep 2010 13:34:50 +0200 Organization: Bauhaus-Universitaet Weimar Message-ID: References: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> Reply-To: stefan-lucks@see-the.signature NNTP-Posting-Host: medsec1.medien.uni-weimar.de Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: tigger.scc.uni-weimar.de 1285666436 11283 141.54.178.228 (28 Sep 2010 09:33:56 GMT) X-Complaints-To: news@tigger.scc.uni-weimar.de NNTP-Posting-Date: Tue, 28 Sep 2010 09:33:56 +0000 (UTC) X-X-Sender: lucks@medsec1.medien.uni-weimar.de In-Reply-To: <853314bc-0f79-435f-86a5-d7bcdd610731@c10g2000yqh.googlegroups.com> Xref: g2news1.google.com comp.lang.ada:14289 Date: 2010-09-28T13:34:50+02:00 List-Id: On Tue, 28 Sep 2010, Maciej Sobczak wrote: > package Objects is > > type Object is interface; > type Object_Access is access all Object'Class; > > procedure Do_Something (X : in out Object) is abstract; > > end Objects; [...] Compiler doesn't like Objects.Object_Access: > procedure Use_Object (X : Objects.Object_Access); [...] Anymous access works, but is ugly: > procedure Use_Object (X : access Objects.Object'Class); [...] > Any thoughts on this? Not an answer to your question -- but what requirements force you to use an access type at all? To me, the most natural would be to write "X: in out Objects.Object": limited with Objects; package Use_Objects is procedure Use_1(X: access Objects.Object); -- compiles fine procedure Use_2(Y: in out Objects.Object); -- compiles fine procedure Use_3(Z: Objects.Object_Access); -- invalid use of incomplete type end Use_Objects; -- ------ Stefan Lucks -- Bauhaus-University Weimar -- Germany ------ Stefan dot Lucks at uni minus weimar dot de ------ I love the taste of Cryptanalysis in the morning! ------