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,8ceb83dbf250e264 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Problem with instantiating generic procedure Date: 1999/07/19 Message-ID: <37934B7D.926D3B6D@averstar.com>#1/1 X-Deja-AN: 502757431 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <7mqfcq$9og$1@pegasus.csx.cam.ac.uk> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-07-19T00:00:00+00:00 List-Id: Markus Kuhn wrote: > ... > > What is wrong with simply implementing a procedure declared > in the spec file in the body file by instantiating it from > a generic procedure of the exact same signature? Both A and G > have no parameters, so how can there be a conflict? We considered allowing a subprogram spec to be completed by a generic instantiation during the 9X design process. Ultimately we chose to only allow renaming-as-body. So if you want to do this, you must first do the instantiation using a different name, and then define the body by renaming this generic. The rationale behind disallowing a generic instance to be used directly was as follows: A generic instantiation does not include any parameter profile for the subprogram being defined. Hence, matching it up with a spec in the presence of overloading could be difficult for the reader. On the other hand, a renaming includes a parameter profile. Hence, matching a spec with a renaming-as-body did not impose any extra burden on the reader. Therefore, given the general preference for readability over writability, renaming-as-body was proposed as the general solution to problems like this, and instantiation-as-body was not allowed. That's the rationale. I will admit we had a fair amount of discussion before we came to consensus. It is always tricky to negotiate these readability versus writability issues. In the long run the emphasis on readability always seems wise, but in the short term, the emphasis sometimes comes across as just being arbitrarily picky. > ... > > Any idea what is wrong here? You need to use renaming-as-body instead. > > Markus > > -- > Markus G. Kuhn, Computer Laboratory, University of Cambridge, UK > Email: mkuhn at acm.org, WWW: -- -Tucker Taft stt@averstar.com http://www.averstar.com/~stt/ Technical Director, Distributed IT Solutions (www.averstar.com/tools) AverStar (formerly Intermetrics, Inc.) Burlington, MA USA