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: "James A. Squire" Subject: Re: Subprogram Renaming Date: 1996/04/10 Message-ID: <316C1474.4B03@csehp3.mdc.com>#1/1 X-Deja-AN: 146833541 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-10T00:00:00+00:00 List-Id: On Tue, 9 Apr 1996 10:22:47, Gary McKee wrote: > 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'. OK. I can see in some cases where this 'contract' is actually useful. Of course, the only implementation that is being put into the spec is the actual name and location of the implementation. Every thing else is interface details which are supposed to be public. Frankly, I've seen worse cases than subprogram specs as far as breaking modularity, abstraction, and information hiding, which are allowed by both Ada83 and Ada95, such as defining a variable (already a no-no in my book) by renaming a function call. What I see is that if you rename a subprogram from another package in your package spec, then you have to with in the other package in the spec, which means that potentially the other package spec can have an affect on the user of your package, which you may not want. Of course, if you really don't want the user to pay any attention to the other package, you should make the other package a private child of your package, at which point Ada95 requires you to rename your public subprogram as the body of a subprogram in that private child. -- 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!"