From: dweller@dfw.net (David Weller)
Subject: Re: (no subject)
Date: 1996/04/09
Date: 1996-04-09T00:00:00+00:00 [thread overview]
Message-ID: <4kecpk$ltg@dfw.dfw.net> (raw)
In-Reply-To: 4ke8pk$bua@post.tau.ac.il
In article <4ke8pk$bua@post.tau.ac.il> you write:
>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
This is very similar to how the Booch Components does it...
>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)
>
>package Sets is
>
>generic
> type Set_Element is private;
>
>package Abstract_Sets is
>
> type Set is abstract tagged private;
>
> ..[various functions deleted]
>
>private
> type Set is abstract tagged null record;
>end Abstract_Sets;
>
I think you want:
generic
type Set_Element is private; -- or (<>), depending on your preferences
package Sets is
type Set is abstract tagged private;
[same functions that you already had...]
private
type Set is abstract tagged with null record;
end Sets;
then...
generic -- must have "generic" since parent is a generic
package Sets.List_Based is
type List_Set is new Set with private;
[redefinitions of abstract operations]
private
type List_Set is new Set with record...
end Sets.List_Based;
Similarly for Sets.Array_Based (or whatever you call them)
next prev parent 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 (no subject) chico
1996-04-09 0:00 ` David Weller [this message]
-- 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