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,29d8139471e3f53e X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!l20g2000yqm.googlegroups.com!not-for-mail From: Cyrille Newsgroups: comp.lang.ada Subject: Re: Preventing type extensions Date: Fri, 8 Oct 2010 00:50:04 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <87iq2bfenl.fsf@mid.deneb.enyo.de> <81799aab-a2e8-4390-8f42-abceaa5fc032@m1g2000vbh.googlegroups.com> <5c0d7798-ba09-4bd0-a28f-f1b028cce927@y3g2000vbm.googlegroups.com> <9df21c09-f611-4088-811c-c092452adffc@e20g2000vbn.googlegroups.com> <37ae2382-9f7d-4790-be5f-e380b9220d75@s19g2000vbr.googlegroups.com> NNTP-Posting-Host: 212.99.106.125 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1286564486 13499 127.0.0.1 (8 Oct 2010 19:01:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 8 Oct 2010 19:01:26 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l20g2000yqm.googlegroups.com; posting-host=212.99.106.125; posting-account=bNhsVwoAAAB6XmNPWgYcbUm6npIwL2C4 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10 ( .NET CLR 3.5.30729),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:14440 Date: 2010-10-08T00:50:04-07:00 List-Id: On Oct 5, 7:02=A0pm, "J-P. Rosen" wrote: > Hmmm... pessimistic testing is certainly impractical for C++, but I > wonder if it applies to Ada as well. I don't see any reason why it would be more practical in one language than the other. It depends on the amount of dispatching calls and the size of your class hierarchy. > >> To conclude about differentiating T and T'Class, the trick you suggest > >>> here is easily implementable in other OO languages. There is nothing > >>> magic in creating a wrapper around a given dispatching call and use > >>> this wrapper at each dispatch point. > > Not at all, in other languages either a subprogram is a method (part of > the dispatch table), or it applies to a single type. Class-wide > operations are not dispatched, but still can be applied to a whole > hierarchy. OK, I dismiss "void *" parameters... Well my C++ is a bit rusty but I think this is exactly the other way around. a subprogram is a method or it applies to the whole class hierarchy by default and not a single type as you seem to think. Here is an example in C++, 'subp' has a parameter that is a ref to the specific class C1 and you can pass it an object of any descendant of C1 without any problems. Looks like what you call a classwide operations to me... In the body you can even choose between dispatching or not dispatching using a slightly different syntax as shown. So really, classwide programming is not specific to Ada... only the explicit notation is. << #include using namespace std; class C1 { public: virtual int m() {return a;} C1 () { a =3D 1; } int a; }; class C2: public C1 { public: virtual int m() {return b;} C2 () { a =3D 2; b =3D 3;} int b; }; void Subp (C1 &c) { cout << "dispatching to m " << c.m() << endl; cout << "not dispatching to C1::m " << c.C1::m () << endl; } int main () { C1 c1; C2 c2; Subp (c1); Subp (c2); } >> > > If you (or anyone else on this list, or even in outer space ;) ) have > good ideas about what to put in that profile, by all means, come to the > workshop, or make a proposal (private mail to me, I'll gather proposals). > We definitely have ideas and are planning to work on such a profile in the near future but not in the schedule of the workshop so I'm afraid we will have to synchronize at a later date.