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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ac5c3bc59168d76 X-Google-Attributes: gid103376,public From: "James A. Squire" Subject: Re: Subprogram Renaming Date: 1996/04/09 Message-ID: <316AEA8D.7600@csehp3.mdc.com>#1/1 X-Deja-AN: 146622269 sender: Ada programming language references: comments: Gated by NETNEWS@AUVM.AMERICAN.EDU content-type: text/plain; charset=us-ascii organization: MDA Avionics Tools & Processes mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (X11; I; HP-UX A.09.01 9000/715) Date: 1996-04-09T00:00:00+00:00 List-Id: Robert A Duff wrote: > In article <316951C3.CE4@csehp3.mdc.com>, > James A. Squire wrote: > >> package q is > >> procedure j; > >> end q; > >> > >> package body q is > >> ... > >> procedure j renames k; > > > >which looks like a rename of a spec to me. I can do this in Ada83. > > No, the above is illegal in Ada 83. In Ada 83, you have two > declarations of J, which are homographs, and therefore illegal. And you > have a missing body for the first J, which is also illegal. The new You are right about that. That comment was my mistake. However (!!!)... > thing in Ada 95 is that the renaming can act as the body of the first J. > This is no big deal -- the renaming is just a short-hand notation for > "procedure j is begin k; end;". But it was illegal in Ada 83. Still (!) Nobody has answered the $64,000.00 question: WHY IS THIS SUCH A GOOD THING? In other words, why did they waste their time adding this ability to rename a subprogram body. Why should I do: package q is procedure j; end q; package body q is procedure k; procedure j renames k; end q; when I can do: package q is procedure k; end q; package body q is procedure k is ... end q; Now that I KNOW I can do in Ada83. Since the parameter spec has to match exactly, I see no point to doing a rename in the body and hiding it from the user. All you are changing is the name it goes by. What's the point? > As Robert Dewar said, this has nothing to do with syntax rules -- the > syntax for renamings is the same. The difference is where they're > allowed, and what they mean. To find the rules, you have to look at the > text under subprogram renamings (as opposed to just looking at the BNF > syntax rules). I read those - 8.5.4 and 6.3.1. What does "subtype of the profile" mean? -- James Squire MDA Avionics Tools & Processes ja_squire@csehp3.mdc.com "one of these days I'm going to better myself by going to Knight school" "You'll be a web knight instead of a web page!"