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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8c424d8135e68278 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-14 02:36:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!130.133.1.3!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: dmitry@elros.cbb-automation.de (Dmitry A. Kazakov) Newsgroups: comp.lang.ada Subject: Re: Ada2005 Date: Fri, 14 Dec 2001 10:36:28 GMT Message-ID: <3c19d348.7929234@News.CIS.DFN.DE> References: <9v4jsj$bd1$1@infosun2.rus.uni-stuttgart.de> <9v7f26$qn2$1@infosun2.rus.uni-stuttgart.de> <3C1754BA.C4560423@informatik.uni-jena.de> <9v7q8r$1f5$1@infosun2.rus.uni-stuttgart.de> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) X-Trace: fu-berlin.de 1008326188 15253037 212.79.194.111 (16 [77047]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:17904 Date: 2001-12-14T10:36:28+00:00 List-Id: On Thu, 13 Dec 2001 23:40:59 -0500, Patrick Hohmeyer wrote: >Peter Hermann wrote : >> >> The opposite is true: the Ada concept is more charming IMHO >> in that the methods defined in the context belong to the >> tagged type. The defining scope is crucial. >> > >Hmmm, perhaps, but not for polymorph methods : > >C++ : >Polymorph methods must be declared with the keyword virtual >inside the brackets of the class definition. > >Ada95 : >Polymorph methods must be declared after the type definition >but befor it's freezing point. >The freezing point is one of the following <>, there may be >more then one and which one arrives first may actually >depend on your compiler, optimisation flags and your hair-color. > >Huh? >In this case I find the C++ definition *way* easier to understand >than this Chapter 13 babbeling of Ada. > >IMO this should somehow be revised for Ada0x. Egh, there shall be a freezing rule. It is just that in C++ the freezing point is the } closing the class declaration. Another question is the keyword "virtual". I think it would be possible to introduce special keywords / attributes / pragmas indicating whether a particular parameter is dispatching or not. Like: type X is tagged ... procedure Surprize (A : X; B : X'Do_not_dispatch); -- (:-)) Presently all non-class-wide parameters (of the type) are dispatching. In C++ all parameters are non-dispatching, except the hidden one, if the keyword virtual is applied. I am not very sure that non-dispatching parameters make much sense. But in any case Ada's way is more consistent (consider multiple dispatch etc) Regards, Dmitry Kazakov