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,8029f6524ed823f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-06-04 10:28:41 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.cwix.com!sjc-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: Specialization of generics In-Reply-To: <9fgcmj$9jb$1@news.huji.ac.il> Message-ID: References: <46ba9d66.0106031617.c802df3@posting.google.com> <9ffnvi$qtl$1@news.huji.ac.il> <9fgcmj$9jb$1@news.huji.ac.il> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 04 Jun 2001 17:28:39 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 991675719 206.184.139.136 (Mon, 04 Jun 2001 17:28:39 GMT) NNTP-Posting-Date: Mon, 04 Jun 2001 17:28:39 GMT Organization: Verio Xref: archiver1.google.com comp.lang.ada:8077 Date: 2001-06-04T17:28:39+00:00 List-Id: On Mon, 4 Jun 2001, Ehud Lamm wrote: > > Right. For me the easiest is to just have two generics (one for each > > "specilization"). > > --- > > T.E.D. homepage - http://www.telepath.com/dennison/Ted/TED.html > > > Yap, that's what I'd do. > What I really miss is being able to overload generic units. For example, > imagine a package that can work on any non-limited type, but has a more > efficient version ("specialization") is the type is ordered (i.e, has an "<" > operator). The client code "simply" instantiates the unit, getting the > appropriate version automagically. OK, I tried to sit on my hands, but I can't resist. Along these lines, you can look at http://www.acm.org/pubs/citations/proceedings/ada/126551/p338-shen/#indterms which is not exactly what you're talking about but would provide some similar capabilities. I'd have really liked something like this in Ada. Who knows, maybe SPARK will evolve into a new language with parametric polymorphism. -- Brian