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 r15mr3455620wiv.4.1353447518662; Tue, 20 Nov 2012 13:38:38 -0800 (PST) MIME-Version: 1.0 X-FeedAbuse: http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 Path: ha8ni269wib.1!nntp.google.com!proxad.net!feeder1-2.proxad.net!nntpfeed.proxad.net!news.muarf.org!news.ecp.fr!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Tue, 20 Nov 2012 15:38:37 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <114a6fcf-32c3-408f-961f-2e3bf3c5af04@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1353447518 10314 69.95.181.76 (20 Nov 2012 21:38:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 20 Nov 2012 21:38:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 X-RFC2646: Format=Flowed; Original Date: 2012-11-20T15:38:37-06:00 List-Id: "Adam Beneschan" wrote in message news:114a6fcf-32c3-408f-961f-2e3bf3c5af04@googlegroups.com... On Monday, November 19, 2012 4:05:16 PM UTC-8, Randy Brukardt wrote: >> "Randy Brukardt" wrote in message >> I should point out that I don't think that the code you wrote actually >> would >> solve the problem you were trying to solve. That's because you usually >> need >> to make dispatching calls, and such a call would be bound to a subprogram >> when you wrote the name "Message.Print" and not when you actually made >> the >> call. >If Message had type Message_Type'Class, I'd assume that at some point, >Message.Print'Access would need to determine which Print subprogram would >be >called, and figure out the address of it. I don't think it matters whether >it's done when the >'Access value is computed or when the call is made, since the tag of an >object can't be >changed during the object's lifetime. I could be wrong, though; maybe I've >missed a case >where it matters. (But I'm not concerned about the possibility of an >object's tag being >changed through extralegal means like Unchecked_Conversion.) I don't think this is quite true; if the object is a parameter (for instance), it can have different tags for different calls. But I don't see that happening for something like Param.Print'Access -- access values are never dispatching. Anyway, since something like Param.Print'Access is illegal in any case, we don't have to decide what this means or how code would be generated for it. Randy. -- Adam