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: gmckee@cloudnine.com (Gary McKee) Subject: Re: Subprogram Renaming Date: 1996/04/09 Message-ID: #1/1 X-Deja-AN: 146577106 references: <316951C3.CE4@csehp3.mdc.com> organization: McKee Consulting (Consulting in Ada) newsgroups: comp.lang.ada Date: 1996-04-09T00:00:00+00:00 List-Id: In article , dewar@cs.nyu.edu (Robert Dewar) wrote: > James Squire said > > "And my question was, why does being able to rename a subprogram AS A > BODY matter? What is so NEW about this? Why should I care about this > NEW thing?" > > Well any new feature may or may not be useful to you, but please study > my example more carefully, you CANNOT do whyat I suggested in Ada 83. > > The new feature is, as shown in my example, the ability to provide a > completion using a renaming, instead of a normal body. This saves having > to write a junk wrapper routine with an extra call. > > It is most useful when used in the private part of a spec. -------------------------------------------------------- The rationale given when this change was submitted to the requirements team was as follows: The avowed purpose of a package specification is to offer a 'contract' for delivery of software services as implemented by the package body. When a subprogram is implemented via a renaming of another subprogram (procedure j renames k;), the 'contract' is compromised because the implementation must be placed in the specification. This is contrary to the paradigms of 'modularity, abstraction, and information hiding'. The workaround is, of course, the wrapper body in the package body. This adds complexity and potential error without increasing the quality, value, or ease of use of the language. The intent of this change was to permit EXACTLY the renaming that you used in your example: >> package q is >> procedure j; >> end q; >> >> package body q is >> ... >> procedure j renames k; This was not previously legal. I submitted the request for change because I was, at the time, teaching Ada83 full time for an aeorspace company and nearly every student sooner or later tried to do what you suggested in your example and I could never explain why it should be prohibited. Now, it is permitted, Yeah! -------------------------------------------------------------------- Gary McKee McKee Consulting gmckee@cloudnine.com P. O. Box 3009 voice: (303) 795-7287 Littleton, CO 80161-3009 WWW home page => --------------------------------------------------------------------