comp.lang.ada
 help / color / mirror / Atom feed
From: "Eyal Ben-gal" <eyalbengal@hotmail.com>
Subject: Generic Packages
Date: Thu, 19 Apr 2001 23:27:09 +0200
Date: 2001-04-19T20:18:55+00:00	[thread overview]
Message-ID: <9bnh7f$5di$1@news.inter.net.il> (raw)

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.






             reply	other threads:[~2001-04-19 21:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-19 21:27 Eyal Ben-gal [this message]
2001-04-19 20:26 ` Generic Packages Ehud Lamm
2001-04-19 22:09 ` Robert A Duff
2001-04-20  6:50   ` Ehud Lamm
  -- strict thread matches above, loose matches on Subject: below --
2002-07-09 13:03 generic packages Sami Evangelista
2002-07-09 13:28 ` Fabien Garcia
2002-07-09 13:41   ` Sami Evangelista
2002-07-10  2:00 ` SteveD
2002-07-11 13:41   ` Sami Evangelista
2002-07-11 20:56     ` Adam Beneschan
2000-02-16  0:00 Generic packages David Olsson
2000-02-16  0:00 ` R. Tim Coslet
1998-08-10  0:00 Generic Packages Tory Patnoe
1998-08-11  0:00 ` Tucker Taft
1998-08-11  0:00 ` Robert I. Eachus
1998-08-12  0:00 ` Dale Stanbrough
1998-08-17  0:00 ` Dr. Hubert B. Keller
1998-08-27  0:00   ` Simon Wright
     [not found] <5e03nm$esq@netty.york.ac.uk>
1997-02-15  0:00 ` Jon S Anthony
1997-02-20  0:00 ` phtruong
1997-02-21  0:00   ` Robert Dewar
1997-02-25  0:00     ` Quorlia
1997-02-27  0:00       ` Robert Dewar
     [not found] <4inq3c$lr9@NNTP.MsState.Edu>
1996-03-22  0:00 ` John Herro
1996-03-22  0:00   ` Samuel Tardieu
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox