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,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,27b7b39155b8a0d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-09 06:05:09 PST Path: archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!newsfeed.direct.ca!look.ca!wn1feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc51.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: <5ee5b646.0111281941.2620b70a@posting.google.com> Subject: Re: Generics not overloadable X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Sun, 09 Dec 2001 14:05:09 GMT NNTP-Posting-Host: 204.127.202.211 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc51 1007906709 204.127.202.211 (Sun, 09 Dec 2001 14:05:09 GMT) NNTP-Posting-Date: Sun, 09 Dec 2001 14:05:09 GMT Organization: AT&T Broadband Xref: archiver1.google.com comp.lang.ada:17645 Date: 2001-12-09T14:05:09+00:00 List-Id: "Robert Dewar" wrote in message news:5ee5b646.0111281941.2620b70a@posting.google.com... > Ted Dennison wrote in message news:... > > > It annoyed me too when I discovered it > > I find it hard to believe that it would be easy to come > up with an example where it would help the reader to > name two visible generic units with the same name. Why should it make a difference whether they are generic? The principle is the same. As for examples, just about anything will do, but here's one (self-explanatory, I trust)... generic with procedure Action (On : Item); procedure Apply (Over : Collection); generic with procedure Action (On : Item; Continue : out Boolean); procedure Apply (Over : Collection); generic with procedure Action (On : Item); procedure Apply (Start, Finish : in Iterator); generic with procedure Action (On : Item; Continue : out Boolean); procedure Apply (Start, Finish : in Iterator); The user should not have to remember a different fiddly specialized name for each variant. It's much more natural, and easier on the user, if each can be called simply "Apply". > > Indeed, far too often overloading in Ada is misused to > save the bother of thinking of different names. Maybe so, but not by me :-). I take naming too seriously, if anything :-). Incidentally, I realized the reason for the language rule that makes it impossible to overload generics. The wonderful benefit :-) is that I can write generic type Foo is private; with procedure Something (Foo : X.Foo); package X is . . Talk about "saving the bother of thinking of different names"! I'd gladly trade away this liberty in the generic formal part for the ability to overload generics. -- mark