comp.lang.ada
 help / color / mirror / Atom feed
From: chico <manobla@sunshine.cs.biu.ac.il>
Subject: (no subject)
Date: 1996/04/09
Date: 1996-04-09T00:00:00+00:00	[thread overview]
Message-ID: <4ke8pk$bua@post.tau.ac.il> (raw)

I would Like to write an abstract package that will implement Sets in
two ways, one with list and one with array, I need to declare a base 
type and then derive from it. doe's anybody has something like it 
or can help me write it.(I don't know how to write the spec for the
the derived type)

the base is :
with Gnat.IO; use Gnat.IO;

package Sets is 

generic
   type Set_Element is private;

package Abstract_Sets is
  
   type Set is abstract tagged private;

   function Empty return Set is abstract;
   --     Empty Set
   function Unit (Element: Set_Elemet) return Set is abstract;
   --     build Set with 1 element
   function Union (Left, Right: Set) return Set is abstract;
   --     union of two sets
   function intersection (Left, Right: Set) return Set is abstract;
   --     intersection of two sets
   procedure Take (From: in out Set;
                           Element: out Set_Elemet) is abstract;
   --     remove an element from a set

private
   type Set is abstract tagged null record;
end Abstract_Sets;







             reply	other threads:[~1996-04-09  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-09  0:00 chico [this message]
1996-04-09  0:00 ` (no subject) David Weller
  -- strict thread matches above, loose matches on Subject: below --
2006-01-23 15:56 Per Sandberg
2002-10-08  2:18 Rick Duley
2001-05-05 10:43 <no subject> Kent Paul Dolan
2001-05-05  8:25 Kent Paul Dolan
1999-09-15  0:00 (no subject) Justine O'Hara
1999-09-14  0:00 ` Keith Thompson
1998-11-13  0:00 niel.williams
1998-11-13  0:00 ` dennison
1998-11-13  0:00   ` Robert I. Eachus
1997-08-18  0:00 Moustafa abdul wahab
1997-06-03  0:00 Matthew Daniel
1997-01-23  0:00 Mathieu POUPARDIN
1996-12-31  0:00 <no subject> Brad Dale
1996-12-31  0:00 Renegade
1996-06-07  0:00 (no subject) Mark Fisher
1996-04-15  0:00 Markus Knasmueller
1996-03-19  0:00 Mike Ibarra
replies disabled

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