comp.lang.ada
 help / color / mirror / Atom feed
From: Ehud Lamm <mslamm@mscc.huji.ac.il>
Subject: Re: How to make a generic controlled type?
Date: 1999/09/24
Date: 1999-09-24T00:00:00+00:00	[thread overview]
Message-ID: <Pine.A41.3.96-heb-2.07.990924231027.43996A-100000@pluto.mscc.huji.ac.il> (raw)
In-Reply-To: 7sg9cg$mvm$1@nyheter.chalmers.se

The following seems to compile fine on my system. What problem do you have
exactly?

with Ada.Finalization;

generic
   type Element_Type is private;

package Bug_List is

   type List is new Ada.Finalization.Limited_Controlled with private;

   -- Insert E at the current location.
   procedure Insert (L: in out List;
                     E: in     Element_Type);
private

   type Node;
   type Link is access Node;
   type Node is record V:Element_Type; N:Link; end record;
   type List is new Ada.Finalization.Limited_Controlled with
   record
      H:Link;
   end record;
   
   procedure Initialize(L:in out List);
   procedure Finalize  (L:in out List);
end;                     

By the way, just a day ago I submitted an example of a "simple controlled
list" to AdaPower (to accompany my example of a simple polymorphic list).
I don't think it is there yet but I guess it should be soon. You may want
to take it and start from there.

Ehud Lamm mslamm@mscc.huji.ac.il
http://purl.oclc.org/NET/ehudlamm <== My home on the web 
Check it out and subscribe to the E-List- for interesting essays and more!






  reply	other threads:[~1999-09-24  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-09-24  0:00 How to make a generic controlled type? Anders Gidenstam
1999-09-24  0:00 ` Ehud Lamm [this message]
1999-09-26  0:00   ` David Botton
replies disabled

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