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,ad988eb0a9545c86 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-12 11:18:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!freenix!sunqbc.risq.qc.ca!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.rdc1.sfba.home.com.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Problem trying to implement generics. References: <9b46dr$cd8$1@taliesin.netcom.net.uk> X-Newsreader: Tom's custom newsreader Message-ID: Date: Thu, 12 Apr 2001 18:15:11 GMT NNTP-Posting-Host: 24.20.190.201 X-Complaints-To: abuse@home.net X-Trace: news1.rdc1.sfba.home.com 987099311 24.20.190.201 (Thu, 12 Apr 2001 11:15:11 PDT) NNTP-Posting-Date: Thu, 12 Apr 2001 11:15:11 PDT Organization: Excite@Home - The Leader in Broadband http://home.com/faster Xref: supernews.google.com comp.lang.ada:6830 Date: 2001-04-12T18:15:11+00:00 List-Id: > if current.sorted_by > sort then As Andy pointed out in message <3AD5B43F.6A5B@ozonline.com.au>, the problem is probably that the compiler doesn't know how to compare two objects whose type it doesn't know, and you therefore need to add a with function "<" and give it a comparison function it can call. > What does use type does? How do I use it? The book should explain that. If it doesn't do a good job, try a different book. It's sort of a shorthand "use" that just applies to operators imported from another package, so you don't have to say x := other_package."+"(a,b); but can say "x := a+b;" > That solved the problem, but why? What does aliased mean? If you have a variable x, and also a pointer p that points to x (p := x'access) then "x" and "p.all" are two different names, or aliases, for the same thing. Declaring "x : aliased some_type;" alerts a reader of the program to the possibility the value of x may change during a code sequence that appears to have to mention of x (but has "p.all := 7;", for instance). It also tells the compiler that if it makes a temporary copy of x, in a register, say, it must take account of the possibilty that x is supposed to be changed by references to p. >The only thing I can think of is that this doesn't work because the function >is not declared on the ads file. Inside the body of the function, where the error occurs, it doesn't matter where the spec of the function was first declared. You say other functions use this variable just fine. What's different?