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.4 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FORGED_MUA_MOZILLA,FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,26a21b9e317dc639 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.216.144.145 with SMTP id n17mr1105169wej.11.1353556610742; Wed, 21 Nov 2012 19:56:50 -0800 (PST) Path: q13ni13189wii.0!nntp.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!91.203.106.13.MISMATCH!border1.hitnews.com!xlned.com!feeder7.xlned.com!newsfeed10.multikabel.net!multikabel.net!newsfeed20.multikabel.net!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border2.nntp.dca.giganews.com!nrc-news.nrc.ca!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail NNTP-Posting-Date: Mon, 19 Nov 2012 14:57:22 -0600 Date: Mon, 19 Nov 2012 15:57:21 -0500 From: "Peter C. Chapin" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121028 Thunderbird/16.0.2 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> <2d141696-2cd2-4805-8c51-cf6620abc9ce@googlegroups.com> In-Reply-To: <2d141696-2cd2-4805-8c51-cf6620abc9ce@googlegroups.com> Message-ID: X-Usenet-Provider: http://www.giganews.com X-Trace: sv3-Hg5dK+PvgEtihwLTOjF1oCtcAFn4OXpVPapvusOrHCTPSIczp5Mnx5vT8/anvO6fUSkf6kzi4AVOZcv!QVcer5tWynnjwwx+kdJ05yEHZ+k6aaUg5ryjhikwju8//mtQKjTWKasFRPjZS4M= X-Complaints-To: abuse@giganews.com X-DMCA-Notifications: http://www.giganews.com/info/dmca.html X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 2571 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-11-19T15:57:21-05:00 List-Id: On 11/19/2012 01:23 PM, Adam Beneschan wrote: >> class Example { >> public: >> void f( int ); >> }; >> >> // Declare p to be "pointer to member function of Example... >> // Initialize p to point at Example::f. >> void (Example::*p)( int ) = &Example::f; >> >> Example object; // Create an object. >> object.*p(42); // Invoke member f indirectly on 'object' > > This doesn't look at all like what I'm talking about, since &Example::f still refers to a method defined for the class Example but without reference to a particular object. Something equivalent would be if you could say &object.f (or maybe &object.*p) and store the result of that in a pointer that could be called later. It's not exactly the same for sure but there are similarities. Here you can create the pointer without reference to any particular object but you need an actual object in order to use it. It seems like what you're talking about would be a kind of partial evaluation since you'd have a pointer to a subprogram that has one of its parameters already specified but the others not. I'm not saying that's a bad thing, I'm just trying to understand the ramifications. Peter