comp.lang.ada
 help / color / mirror / Atom feed
* Problem with generic package
@ 2014-04-15 18:26 Laurent
  2014-04-15 19:36 ` Adam Beneschan
                   ` (2 more replies)
  0 siblings, 3 replies; 20+ messages in thread
From: Laurent @ 2014-04-15 18:26 UTC (permalink / raw)


Hi

As an exercise I have created a generic search function. Because my library folder begins to get messy I tried to put some related parts together in a package.

https://github.com/Chutulu/Library.git

The generic swap and sort are working as standalone but in my package I get this error:

expect generic subprogram in instantiation

No idea what the compiler tries to explain.

Thanks

Laurent


package body Array_Generics is

   procedure Swap_Generic (Value1, Value2 : in out Element_Type) is

      Temp_Value : Element_Type;

   begin -- Swap_Generic

      Temp_Value := Value1;
      Value1 := Value2;
      Value2 := Temp_Value;

   end Swap_Generic;

   procedure Sort_Generic (List : in out List_Type) is

      -- We need to make an instance of Swap_Generic for this case

      error ==>procedure Exchange is new Swap_Generic (Value_Type => Element_Type); <== error

      Index_Of_Min : Index_Type;

      .
      .
      .


^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2014-04-16 23:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15 18:26 Problem with generic package Laurent
2014-04-15 19:36 ` Adam Beneschan
2014-04-15 19:44 ` Adam Beneschan
2014-04-15 20:12   ` Laurent
2014-04-15 20:37     ` Adam Beneschan
2014-04-15 20:43     ` Eryndlia Mavourneen
2014-04-15 20:47       ` Eryndlia Mavourneen
2014-04-15 21:28     ` Georg Bauhaus
2014-04-15 20:41 ` Simon Wright
2014-04-15 21:12   ` Laurent
2014-04-15 21:27     ` Adam Beneschan
2014-04-15 21:58       ` Laurent
2014-04-15 22:03         ` Adam Beneschan
2014-04-16  6:03         ` Georg Bauhaus
2014-04-16 20:37           ` Laurent
2014-04-16 21:13             ` Mike H
2014-04-16 22:31               ` Randy Brukardt
2014-04-16 23:06               ` Jeffrey Carter
2014-04-15 22:14     ` Simon Wright
2014-04-16 18:49       ` Laurent

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