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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,189a28164788ed2e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-31 07:55:51 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Matthew Heaney" Newsgroups: comp.lang.ada Subject: Re: Using "with function" Date: Wed, 31 Oct 2001 10:58:58 -0500 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: <3BDFA1A2.EAF8B6AA@adaworks.com> X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4807.1700 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 X-Complaints-To: newsabuse@supernews.com Xref: archiver1.google.com comp.lang.ada:15483 Date: 2001-10-31T10:58:58-05:00 List-Id: "Richard Riehle" wrote in message news:3BDFA1A2.EAF8B6AA@adaworks.com... > It is nice to hear from Matthew Heaney. He has been absent for far too > long from this forum, and we always enjoy his comments. Good to be back. Hope you're looking forward to some arguments! > I am going to respectfully disagree with Matthew on this. While using the > "box" makes it easier to instantiate the "with function" it also carries with > it some danger. Both Booch and Ed Berard made the case many years > ago for avoiding the use of operators directly in generic formal function > parameters. Do you mean operatORS specifically, or any generic formal subprogram? Also, can you be more specific about what their objection is? Do you have any references? > In the GRACE components it was common to see somethin > like this: > > generic > type Element_Type is private; > with function Is_Equal(L, R : Element_Type) return Boolean; > package GP ... > > This has the effect of demanding that the instantiating unit supply a > generic actual parameter. But isn't this required only because Ada83 wouldn't let you pass the operator form for equality? In Ada83 you *had* to do it this way, or resort to loopholes like the Goodenough Trick. > I recall a PhD thesis from Ohio State (apologize for forgetting the > author's name) in which the case was made for making all generic > formal parameters limited private and requiring the instantiation > to provide all kinds of operations, including a copy procedure > since assignment cannot be overloaded. Do you have a more specific reference? If you can narrow down the year then maybe we can do a UMI search. > Of course, now that we can create generic signature packages in > Ada 95, that is packages that contain only generic formal parameters > for further instantiation of generic formal package parameters, the > Ohio State thesis gains a bit more credibility. Generic formal package parameters are very helpful.