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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.74.79 with SMTP id r15mr117321wiv.4.1354571783113; Mon, 03 Dec 2012 13:56:23 -0800 (PST) X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 88.191.116.97 Path: ha8ni133157wib.1!nntp.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!nntpfeed.proxad.net!dedibox.gegeweb.org!gegeweb.eu!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Brian Drummond Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Mon, 3 Dec 2012 21:56:22 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> Mime-Version: 1.0 Injection-Date: Mon, 3 Dec 2012 21:56:22 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="dfff62e1e537b55df42008571c03e0fe"; logging-data="7581"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19P3/TZm1mDQMevGjMDZ9gMBVu565U21yI=" User-Agent: Pan/0.139 (Sexual Chocolate; GIT bf56508 git://git.gnome.org/pan2) Cancel-Lock: sha1:rQsQkA49ILEr2w3d/f60JEkMDK0= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Date: 2012-12-03T21:56:22+00:00 List-Id: On Mon, 03 Dec 2012 08:17:26 -0800, ake.ragnar.dahlgren wrote: > On Thursday, November 22, 2012 1:13:27 PM UTC+1, Brian Drummond wrote: >> On Thu, 22 Nov 2012 01:47:39 -0800, ake.ragnar.dahlgren wrote: > I want >> to thank everybody for replying. I had no idea about the > "renames" >> feature as Randy pointed out. Brian expressed it very well: I > am >> astonished! But heed Randy's warning : (I may have been confused among >> the discussion and speculation, but my understanding is this: >> corrections welcome!) the Renames is legal and intended to work as >> demonstrated: taking its access is ILLEGAL... >> Brian > > Thank you for your suggestion to use Gate3. I will check it out. > > Yesterday I posted Ada code which uses Access on a renamed procedure. > It's not clear to me but is it really illegal as you write? I hope you > are not sure since you wrote corrections are welcome. I was expecting corrections on the legality of the rename in the first place; Randy and Adam have me convinced that taking its access is a Gnat fluke... I *think* the answer is to register On_Quit as an Object_Handler rather than a Builder_Handler, as I suggested on Nov.20, to overcome the restrictions on argument type for a Builder Handler (which if I understand, is why you need the Rename contortion to make the first argument disappear) Unfortunately, the correct way to use Object_Handler does not seem to have documentation/example code to help people like me get started ... yet. In my original example (linked from the ada.dk tutorial), the restriction on parameter formats for handlers was questioned in the comments, but I don't know the answers yet. But I am convinced there *will be* a better way than the rename trick (and legal!) when we find it... - Brian