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,CP1252 X-Google-Thread: 103376,fba93c19bb4e7dbd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-16 10:44:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!wn14feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi_feed4!attbi.com!rwcrnsc54.POSTED!not-for-mail Message-ID: <3F158F03.5020806@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Q: Endless loop by dispatching References: <3F0ED2C8.6080409@snafu.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 66.31.71.243 X-Complaints-To: abuse@comcast.net X-Trace: rwcrnsc54 1058377476 66.31.71.243 (Wed, 16 Jul 2003 17:44:36 GMT) NNTP-Posting-Date: Wed, 16 Jul 2003 17:44:36 GMT Organization: Comcast Online Date: Wed, 16 Jul 2003 17:44:36 GMT Xref: archiver1.google.com comp.lang.ada:40346 Date: 2003-07-16T17:44:36+00:00 List-Id: Dmitry A. Kazakov wrote: > One should invent a good syntax suggar for this. Which is rather > difficult. There are actually two things in it: That is putting it VERY mildly. > 1. There should be a way to declare some primitive operation saying > that it cannot be overriden completely. One might wish it for things > like Initialize/Finalize. Then probably there should be a way to say > where an override is allowed to add something. > > 2. During overriding one should specifiy where the override(s) places > the extension. I think that it should be specified in the body, while > the specification should only say that it gets overridden. > > The question is syntax and a good balance between 1. and 2., i.e > between contract and implementation. The most complicated cases would > emerge from things like Adjust, I suppose. > It is also related to an ability to explicitly specify that a > subroutine is an overriding, not overloading, to avoid undesired > overloading in case ot typo errors. I do not know whether there is an > AI on that. If yes, they should be considered together. There is an AI on this (AI-218). If you try to follow the discussion, you eyes will quickly glaze over. It needs to be fixed, it probably will be fixed, but there is a slight problem. There can be multiple views of a subprogram declaration, and in some views it will be overriding, while in others it is not. This is both why a "confirming" keyword is currently the leading candidate for Ada0Y, and why it is so hard. We don't want a solution that requires a programmer to explicitly confirm the wrong view: package P is type T is tagged private; private type T is new Ada.Finalization.Controlled with...; end P; package P.Q is type NT is new T; procedure Initialize(X: in out NT); -- overriding? Not here. private -- but it is here. procedure Finalize(X: in out NT); -- overriding? Yes, and here. end P.Q; I favor the pragma solution, because you can put the pragma at the point where it says "but it is here," and not confuse anyone. Most ARG members seem to prefer the keyword solution, which requires an "extra" declaration at that point just to use the keyword. Note that 90% of the potential uses are simple. The other 10% are cases where the compiler will probably end up providing education to Ada programmers. Getting that education as painless as possible is the real problem. -- Robert I. Eachus �In an ally, considerations of house, clan, planet, race are insignificant beside two prime questions, which are: 1. Can he shoot? 2. Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and Steve Miller.