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,26a21b9e317dc639 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.66.84.7 with SMTP id u7mr3650859pay.26.1353406301446; Tue, 20 Nov 2012 02:11:41 -0800 (PST) Path: s9ni1464pbb.0!nntp.google.com!news.glorb.com!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!feeds.phibee-telecom.net!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!rt.uk.eu.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) Date: Tue, 20 Nov 2012 11:12:24 +0100 Organization: cbb software GmbH Message-ID: <1ilx4ms9xk5h8.pz5jsnqrogye.dlg@40tude.net> References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> <2d141696-2cd2-4805-8c51-cf6620abc9ce@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-11-20T11:12:24+01:00 List-Id: On Mon, 19 Nov 2012 14:19:46 -0800 (PST), Adam Beneschan wrote: > On Monday, November 19, 2012 1:26:58 PM UTC-8, Dmitry A. Kazakov wrote: >> On Mon, 19 Nov 2012 10:23:13 -0800 (PST), Adam Beneschan wrote: >> >>> 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. >> >> What would you do for: >> >> type T is tagged ... >> >> procedure Foo (X, Y, Z : T) ; >> >> Would the closure carry three objects with it? > > What I'm proposing is a way that one could say something like > > Object.Operation'access > > In Ada, with regard to your procedure Foo, you can say > > X.Foo (Y, Z) > > That's just the way the language is. Two wrongs does not make one right. >> If closures to be supported then they better be a bit more universal than >> just one tagged object + one operation. > > Why? Is there a rule that says that if a proposed change doesn't fix the > entire world, then we shouldn't propose something that improves part of > the world? No idea. It is a great mystery to me what makes into the language and what does not. Considering this one: 1. Why closures at all? 2. Why some arguments are more important than others, unless the programmer specifies so? 3. Why closures must support only tagged types? -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de