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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,be21015280cacd24 X-Google-Attributes: gid103376,public From: dweller@dfw.net (David Weller) Subject: Re: (no subject) Date: 1996/04/09 Message-ID: <4kecpk$ltg@dfw.dfw.net>#1/1 X-Deja-AN: 147074361 references: <4ke8pk$bua@post.tau.ac.il> organization: DFWNet -- Public Internet Access newsgroups: comp.lang.ada Date: 1996-04-09T00:00:00+00:00 List-Id: 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)