comp.lang.ada
 help / color / mirror / Atom feed
* Re: Entries as formal parameters in generic packages.
@ 1986-07-03 16:01 "ANCHOR::PEARSON"
  0 siblings, 0 replies; only message in thread
From: "ANCHOR::PEARSON" @ 1986-07-03 16:01 UTC (permalink / raw)


For what it's worth, VAX Ada allows an entry name to be "withed" as
a formal procedure in a generic package (see example below). I don't
know whether this is permitted or encouraged by the Ada language, but
the fact that DEC did it lends support to the notion that it's possible.

  -  Peter.
(pearson%anchor.decnet@lll-icdc.arpa)


----------------------------------------------------------------------
generic
    with procedure Maybe_an_Entry( s : in string ) ;
package Temp_GP is
    procedure Call_It( s2 : in string );
end Temp_GP;
package body Temp_GP is
    procedure Call_It( s2 : in string ) is
    begin
	Maybe_an_Entry( "is " & s2 );
    end Call_It;
end Temp_GP;

with text_io; use text_io;
with Temp_GP;

procedure temp_proc is
    task T is
	entry Task_Entry( s : in string );
    end T;
    package P is new Temp_GP( T.Task_Entry );
    task body T is
    begin
	accept Task_Entry( s : in string ) do
	    put_line( "The password " & s );
	end;
    end T;
begin
    P.Call_It( "Swordfish" );
end temp_proc;
------

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1986-07-03 16:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1986-07-03 16:01 Entries as formal parameters in generic packages "ANCHOR::PEARSON"

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