comp.lang.ada
 help / color / mirror / Atom feed
From: gmckee@cloudnine.com (Gary McKee)
Subject: Re: Subprogram Renaming
Date: 1996/04/09
Date: 1996-04-09T00:00:00+00:00	[thread overview]
Message-ID: <AD8FEAF79668949B0@p48.denver1.dialup.csn.net> (raw)
In-Reply-To: dewar.829015659@schonberg

In article <dewar.829015659@schonberg>,
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 =>                     <http://www.csn.net/~gmckee/>
--------------------------------------------------------------------




  reply	other threads:[~1996-04-09  0:00 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <md5:046A59600C3FEFC327385C3E914D6997>
1996-04-08  0:00 ` Subprogram Renaming James A. Squire
1996-04-08  0:00   ` Robert Dewar
1996-04-09  0:00     ` Gary McKee [this message]
1996-04-09  0:00   ` Robert A Duff
     [not found] <md5:3CC2294B6049DDBD8790280EABCEDE81>
1996-04-12  0:00 ` James A. Squire
     [not found] <md5:88A5E8822105A2023A0A951BB5EC646E>
1996-04-10  0:00 ` James A. Squire
     [not found] <md5:87494FB95037B9578F62831DE10B6BB3>
1996-04-10  0:00 ` James A. Squire
     [not found] <md5:95D854EBD1A47E0E86027A3CC7DBD9A4>
1996-04-10  0:00 ` James A. Squire
1996-04-10  0:00   ` Robert Dewar
1996-04-11  0:00     ` Jonas Nygren
1996-04-11  0:00       ` Robert Dewar
1996-04-12  0:00         ` Jonas Nygren
1996-04-10  0:00   ` Robert A Duff
1996-04-11  0:00     ` Adam Beneschan
1996-04-11  0:00       ` Robert Dewar
1996-04-11  0:00       ` Robert A Duff
1996-04-10  0:00 ` johndoe
     [not found] <md5:FE4AB546A8392541EDC1E3FE12E3D8AF>
1996-04-09  0:00 ` James A. Squire
1996-04-09  0:00   ` Robert Dewar
1996-04-10  0:00   ` Robert A Duff
1996-04-11  0:00   ` Mark A Biggar
1996-04-10  0:00 ` johndoe
1996-04-10  0:00   ` Norman H. Cohen
1996-04-11  0:00     ` Norman H. Cohen
1996-04-12  0:00       ` Jonas Nygren
1996-04-12  0:00         ` Norman H. Cohen
1996-04-13  0:00           ` Robert A Duff
1996-04-15  0:00             ` Norman H. Cohen
     [not found] <md5:C24D8C2EE138D9627FB8B93E2E35D9F3>
1996-04-05  0:00 ` James A. Squire
1996-04-06  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox