Article View: net.lang.ada
Article #860Re: Entries as formal parameters in generic packages.
From: "ANCHOR::PEARSON"
Date: Thu, 03 Jul 1986 16:01
Date: Thu, 03 Jul 1986 16:01
40 lines
1720 bytes
1720 bytes
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;
------
Technical Details
Message-ID:
<8607082124.AA21127@ucbvax.Berkeley.EDU>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!nike!ucbcad!ucbvax!LLL-ICDC.ARPA!pearson%anchor.DECnetShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!nike!ucbcad!ucbvax!LLL-ICDC.ARPA!pearson%anchor.DECnet
From: pearson%anchor.DECnet@LLL-ICDC.ARPA ("ANCHOR::PEARSON")
Newsgroups: net.lang.ada
Subject: Re: Entries as formal parameters in generic packages.
Message-ID: <8607082124.AA21127@ucbvax.Berkeley.EDU>
Date: Thu, 3-Jul-86 12:01:00 EDT
Article-I.D.: ucbvax.8607082124.AA21127
Posted: Thu Jul 3 12:01:00 1986
Date-Received: Wed, 9-Jul-86 03:26:03 EDT
Sender: daemon@ucbvax.BERKELEY.EDU
Reply-To: "ANCHOR::PEARSON" <pearson%anchor.decnet@lll-icdc.ARPA>
Organization: The ARPA Internet
Lines: 40