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 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: bobduff@world.std.com (Robert A Duff) Subject: Re: Subprogram Renaming Date: 1996/04/09 Message-ID: #1/1 X-Deja-AN: 146451238 references: <316951C3.CE4@csehp3.mdc.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-04-09T00:00:00+00:00 List-Id: 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 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. 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). - Bob