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,68a59f01eb1998d3 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada generics and private type operations Date: Sat, 14 Oct 2006 10:48:28 +0100 Organization: Pushface Message-ID: References: <%GEXg.237659$1i1.167064@attbi_s72> <1160771945.155748.244730@k70g2000cwa.googlegroups.com> <1160773480.393825.96390@b28g2000cwb.googlegroups.com> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1160819310 14111 62.49.19.209 (14 Oct 2006 09:48:30 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Sat, 14 Oct 2006 09:48:30 +0000 (UTC) Cancel-Lock: sha1:VN9VRmx2Fbpa44J5O9W7RhZG+5E= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news2.google.com comp.lang.ada:6961 Date: 2006-10-14T10:48:28+01:00 List-Id: "Adam Beneschan" writes: > Silly me. I got so distracted by the presence of bird tracks all over > my source that I forgot: you *can't* say ">=" => ">=" five times in > your instantiation, because the thing on the left of the => can't be > ambiguous. > > In fact, if you have more than one "with function >=" in your generic > formal, then you can't say ">=" => anything, even once. Either you > have to let all of them default, or you have to use positional notation > when you're instantiating (12.3(9)). Actually, it's occurred to me > that maybe this was your problem? This is possibly a case for generic signature packages. generic type T is private; with function ">=" (L, R : T) return Boolean is <>; package Type_Signature is end Type_Signature; with Type_Signature; generic with package A is new Type_Signature (<>); with package B is new Type_Signature (<>); package User is function "<" (L, R : A.T) return Boolean; end User; package body User is function "<" (L, R : A.T) return Boolean is begin return not A.">=" (L, R); end "<"; end User;