comp.lang.ada
 help / color / mirror / Atom feed
* instantiation of a procedure
@ 1997-03-06  0:00 "none"
  1997-03-07  0:00 ` john schneider
  0 siblings, 1 reply; 2+ messages in thread
From: "none" @ 1997-03-06  0:00 UTC (permalink / raw)



I'm using GNAT307  (DOS)

I'm trying to interface my client program with a package. The package's 
general structure is 


generic
 type stuff1;
 with function stuff2;
package foo1 is
.
.
  generic
    with procedure stuff3;
    procedure prog1;
    .
    .
    end prog1;
.
.
end package foo1;

I know how to instantiate the package and the generics preceding the 
package statement. But how do I instantiate the procedure stuff3 inside
the package? Note that it is a procedure with a generic within in a 
package and not a package within a package (I think I know that case).  
Also is procedure prog1 referenced any differently than if it were just 
a procedure inside the package with no generic declaration?



-- 
Brian Franklin
Georgia Institute of Technology, Atlanta Georgia, 30332
uucp:	  ...!{decvax,hplabs,ncar,purdue,rutgers}!gatech!prism!bf14
Internet: bf14@prism.gatech.edu




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

* Re: instantiation of a procedure
  1997-03-06  0:00 instantiation of a procedure "none"
@ 1997-03-07  0:00 ` john schneider
  0 siblings, 0 replies; 2+ messages in thread
From: john schneider @ 1997-03-07  0:00 UTC (permalink / raw)



Brian Franklin wrote:
> 
> generic
>  type stuff1;
>  with function stuff2;
> package foo1 is
> .
> .
>   generic
>     with procedure stuff3;
>     procedure prog1;
>     .
>     .
>     end prog1;
> .
> .
> end package foo1;
> 
> I know how to instantiate the package and the generics
> preceding the package statement. But how do I instantiate the
> procedure stuff3 inside the package?

with fool;

procedure use_fool is

   type local_type is ....;

   function local_func ....;

   procedure local_proc;

   package my_fool is new fool( stuff1 => local_type, 
                                stuff2 => local_func );

   procedure THATS_IT is new my_fool.prog1( stuff3 => local_proc );

begin

   --
   -- In here you can use local_func, local_proc, the package
   -- 'my_fool', and the procedure 'THATS_IT'
   --
   null;

end use_fool;


John Schneider
j-schneider@ti.com

The opinions are mine, but you are welcome to borrow them.




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

end of thread, other threads:[~1997-03-07  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-06  0:00 instantiation of a procedure "none"
1997-03-07  0:00 ` john schneider

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