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-Thread: 103376,91276ec2ea911d3f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Generic procedures and their parameters Date: Wed, 06 Sep 2006 16:14:07 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: References: NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1157552046 26351 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Thunderbird 1.5.0.5 (X11/20060801) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:6476 Date: 2006-09-06T16:14:07+02:00 List-Id: Robert A Duff wrote: >> But then, you would need to have even such fundamental things like >> Integer belong to Ordered'Class. It's a shaky ground. > > Why is that shaky? Integer IS ordered. Is it also tagged? Do you want it to be? Or maybe there should be a special case for Integer (and its every subtype), so that it's semantically in Ordered'Class without being syntactically tagged? Is it really in the spirit of Ada? Integer is not only Ordered. It's also Summable, Subtractable, Multipliable, Divideable, Powerable, Incrementable, Decrementable, Comparable, Copyable, Assignable, Imageable and even Aspect_Clauseable, not mentioning Can_Be_Used_As_Array_Index. And it has some others as well. And all this is very important, since there might be other types that share only some of these properties but not others and surely we don't want our Container_Of_Incrementable_And_Divideable_And_Comparable to contain something that isn't, right? (sorry if any of the above is not proper English) ;-) And switching back to serious, I somehow don't like languages that try to apply object-orientedness to absolutely everything. In C++ the fact that int is ordered does not require that it relates to some Ordered class. Such properties - if needed - can be expressed in other ways. > A hierarchy with Object at the top would be a Good Thing, IMHO. Trees > are more aesthetically pleasing than forests. Opinions vary on this subject. :-) > But I think perhaps we should have generic types > (i.e. parameterized types) rather than generic packages. That's what > discriminants do, but they're severely limited. It would make sense to > have a discriminant that is a type, so you could say: > > My_Sequence: Sequence(Element => Integer) := (1, 2, 3); Yes, that would be fine. -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/