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-18 17:25:14 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail Message-ID: <3F188FDA.3000202@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: <3F1857E4.60702@attbi.com> 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 1058574308 66.31.71.243 (Sat, 19 Jul 2003 00:25:08 GMT) NNTP-Posting-Date: Sat, 19 Jul 2003 00:25:08 GMT Organization: Comcast Online Date: Sat, 19 Jul 2003 00:25:13 GMT Xref: archiver1.google.com comp.lang.ada:40491 Date: 2003-07-19T00:25:13+00:00 List-Id: tmoran@acm.org wrote: > What was programmer of Root trying to accomplish when he said > >> type Root_Type is tagged private; He was trying to demonstrate an obscure point about the current definition of overriding. I typically say that, for most Ada programmers 10% of the Reference Manual is relevant, the rest explains in gruesome detail what will happen if you try to shoot yourself in the foot. The ARG combs through that ninety percent, finds the one percent where it is not clear which foot you should hit and worries about it for years. Example programs like this, and like most of the ACATS tests are about consistently hitting the same toe when you miss what you are aiming at. Only a small very fun part of the job is adding new features to the language. (But for every new useful feature, there are also at least ten new ways to shoot at your feet. So the big part of the job is corralling all those nasal daemons. > It seems to me he was trying to say "If you declare a child type > and procedures Initialize or Finalize or Adjust, don't expect them > to be called as if Root_Type was Controlled. If he wanted to let > derived types be Controlled, he should have said: > >> type Root_Type is new Ada.Finalization.Controlled with private; Could have, should have, will learn to. All irrelevant, as I said, the discussion on this starts with the assumptions of gun and foot. The ARG wants to make the foot smaller and the gun harder to point at your own body. But we are only human, the solutions are imperfect, and somewhere out there is a bigger fool than I can imagine. I have to content myself with saving those I can hope to understand. There is another thread about let me find it: --------- test.ads --------- with System.Storage_Elements; use System.Storage_Elements; package Test is type A is record I: Integer; end record; B: A; J: Integer renames B.I; for J'Address use To_Address(0); end Test; --------------------------- What was the author of this code TRYING to do? I have yet to answer that one. If there is a real need here, I should try to find some answer other than, "You may be entitled to a better error message." Does RM 13.3(12) explicitly disallow this case? Yes. Address may be specified for stand-alone objects and for program units via an attribute_definition_clause. Stand-alone object is a technical term defined in RM 3.3.1(1): "An object_declaration declares a stand-alone object with a given nominal subtype..." Since J is declared by a renaming declaration, it is not a stand-alone object. And per 13.3(5), the RM decides where a non-implementation defined attribute can appear in an attribute definition clause. >>But to not be able to declare Leaf.Initialize >>as overriding defeats the whole point. > > Defeats what point? In this case the idea of extending the language to allow the programmer to state whether he expects the declaration to be overriding. Making something overriding and only allowing a user to declare it as non-overriding clearly defeats that intent. So most of the discussion is about how to allow these declarations to be true. No, I'm not crazy and it is hard. Remember any changes that affect real software out in the world require a huge benefit. So we want to fix this without breaking what exists. Note that for this particular example I wrote, whatever is decided will break it. But that is fine. It was written only for exploratory reasons, and whatever the final resolution is, ALL compilers will produce the same output. -- 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.