comp.lang.ada
 help / color / mirror / Atom feed
From: "SteveD" <nospam_steved94@attbi.com>
Subject: Re: generic packages
Date: Wed, 10 Jul 2002 02:00:12 GMT
Date: 2002-07-10T02:00:12+00:00	[thread overview]
Message-ID: <MyMW8.135990$Uu2.30054@sccrnsc03> (raw)
In-Reply-To: 3D2ADF27.8070502@wanadoo.fr

"Sami Evangelista" <sami.evangelista@wanadoo.fr> wrote in message
news:3D2ADF27.8070502@wanadoo.fr...
[snip]
> now i want to declare a generic function which take a A set and return a
> B set according to a function wich take a A element and return B
> element. I have tried this in the generic_set.ads file, but gnat crashes

The following code compiles with no crashes using gnat-3.14p-nt.exe on
Windows 2000.
=======================================================
procedure test is
generic
    type Element is private;
    with function "=" (E1, E2 : in Element) return boolean;
package Generic_Set is
    type Set_Record is private;
    type Set is private;
--     .....
private
    type Set is access Set_record;
    type Set_record is record
       El : Element;
       Others_Els : Set;
    end record;
end Generic_Set;

generic
      with package a_set is new generic_set(<>);
      with package b_set is new generic_set(<>);
      with function a_to_b(A : in a_set.element) return b_set.element;
function a_set_to_b_set(the_set : in a_set.set) return b_set.set;

function a_set_to_b_set(the_set : in a_set.set) return b_set.set is
  dummy : b_set.Set;
begin
  return dummy;
end a_set_to_b_set;

begin
  null;
end test;
==============================================
It's not very useful as it is, I just wanted to reproduce your crash.

SteveD







  parent reply	other threads:[~2002-07-10  2:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2002-07-11 13:41   ` Sami Evangelista
2002-07-11 20:56     ` Adam Beneschan
  -- strict thread matches above, loose matches on Subject: below --
2001-04-19 21:27 Generic Packages Eyal Ben-gal
2001-04-19 20:26 ` Ehud Lamm
2001-04-19 22:09 ` Robert A Duff
2001-04-20  6:50   ` Ehud Lamm
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