comp.lang.ada
 help / color / mirror / Atom feed
From: pearson%anchor.DECnet@LLL-ICDC.ARPA ("ANCHOR::PEARSON")
Subject: Re: Entries as formal parameters in generic packages.
Date: Thu, 3-Jul-86 12:01:00 EDT	[thread overview]
Date: Thu Jul  3 12:01:00 1986
Message-ID: <8607082124.AA21127@ucbvax.Berkeley.EDU> (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;
------

                 reply	other threads:[~1986-07-03 16:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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