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,FREEMAIL_FROM,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c944ce2ba25eeb02,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-19 13:21:43 PST Path: supernews.google.com!newsfeed.google.com!newsfeed.stanford.edu!paloalto-snf1.gtei.net!news.gtei.net!enews.sgi.com!nntp.msen.com!uunet!ash.uu.net!news.inter.net.il!not-for-mail From: "Eyal Ben-gal" Newsgroups: comp.lang.ada Subject: Generic Packages Date: Thu, 19 Apr 2001 23:27:09 +0200 Organization: Internet Gold, ISRAEL Message-ID: <9bnh7f$5di$1@news.inter.net.il> NNTP-Posting-Host: diup-220-130.inter.net.il X-Trace: news.inter.net.il 987711535 5554 213.8.220.130 (19 Apr 2001 20:18:55 GMT) X-Complaints-To: abuse@inter.net.il NNTP-Posting-Date: 19 Apr 2001 20:18:55 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Xref: supernews.google.com comp.lang.ada:7016 Date: 2001-04-19T20:18:55+00:00 List-Id: I have two packages for implementing a polynom. In the first package I'm using linked list (PolyList) and the second is an array (Fixed_Polynom) both of the packeges supporting the same package interface such as: "+", "-", SetFirst, SetNext, GetElement, I've tried to create a generic package which will implement "*", drivation calculation, print and so on. (lets call this packes general_pol) which ofcourse using the SetFirst, SetNext functions when I'm using general_pol with the decleration of explicit type which will be the type to use from the abstruct types of the erlier packages there is no problem, but when i'm trying to make it generic I fail since I'm calling the abstruct data type functions and the compiler ofcourse can't know how to connect that to the type I'm using for the SetFirst, SetNext functions. How can I do that ? generic type Polynom is private package general_Pol is function sum (frst :Polynom; scnd :Polynom) return Polynom; function "*" (first:Polynom; second:Polynom) return Polynom; function derive (plnm:Polynom) return Polynom; procedure print (plnm:in out Polynom); function "=" (first:Polynom; second:Polynom) return boolean; function SetPolynom return Polynom; function Count (x:Polynom) return integer; end general_Pol; How can I create it Generic that will implement in first instatiation for PolyList the additional operations, and later the same for Fixed_Polynom. Thanks, Eyal.