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.66.86.130 with SMTP id p2mr2891377paz.22.1353363587375; Mon, 19 Nov 2012 14:19:47 -0800 (PST) Received: by 10.50.0.166 with SMTP id 6mr3129601igf.7.1353363587175; Mon, 19 Nov 2012 14:19:47 -0800 (PST) Path: 6ni93808pbd.1!nntp.google.com!kt20no3320135pbb.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Mon, 19 Nov 2012 14:19:46 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <9b0bcb37-8ae3-440f-af4f-a796702e4250@googlegroups.com> <49cdda31-d0bd-42f2-8076-65504105d07e@googlegroups.com> <2d141696-2cd2-4805-8c51-cf6620abc9ce@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: Access type to member procedure of instance (Object Oriented programming in Ada) From: Adam Beneschan Injection-Date: Mon, 19 Nov 2012 22:19:47 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-11-19T14:19:46-08:00 List-Id: 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: >=20 >=20 >=20 > > 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. >=20 > What would you do for: >=20 > type T is tagged ... >=20 > procedure Foo (X, Y, Z : T) ; >=20 > 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. The Object.Operation notation doesn't= treat the three parameters as having equivalent importance. If you don't = like this when using Foo, then don't use that feature, and you probably wou= ldn't want to use something like X.Foo'access. And it probably shouldn't b= e used on a procedure like that. But it might help with the case that I th= ink is a lot more common, where a procedure or function *is* considered to = operate primarily on one tagged object more than others. > If closures to be supported then they better be a bit more universal than= =20 > just one tagged object + one operation. Why? Is there a rule that says that if a proposed change doesn't fix the e= ntire world, then we shouldn't propose something that improves part of the = world? I was trying to suggest something that **might** be worthwhile by m= aking certain things easier---I don't know for sure that it's worthwhile, b= ut the fact that someone decided to add this to C# and that someone here as= ked about it makes me think it **could** be worthwhile---but in any case, I= was **not** attempting to try to elevate Ada to Programming Language Nirva= na Perfection. So suppose it would help in a lot of cases but not help in = all cases. So what? -- Adam