From: Jeffrey Carter <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Problem with limited with
Date: Fri, 26 Jul 2013 13:49:08 -0700
Date: 2013-07-26T13:49:08-07:00 [thread overview]
Message-ID: <ksun08$tbn$1@dont-email.me> (raw)
In-Reply-To: <lywqodrv51.fsf@pushface.org>
On 07/26/2013 12:14 PM, Simon Wright wrote:
>
> limited with Pak2;
> package Pak1 is
> type Pak2_T2_P is access all Pak2.T2;
> task type T1 is
> entry E1 (T2 : Pak2_T2_P);
> end T1;
> end Pak1;
>
> package Pak2 is
> task type T2 is
> entry E2;
> end T2;
> end Pak2;
>
> with Pak2;
> package body Pak1 is
> task body T1 is
> The_T2 : Pak2_T2_P;
> begin
> accept E1 (T2 : Pak2_T2_P) do
> The_T2 := T2;
> end E1;
> The_T2.E2; -- compilation fails
> The_T2.all.E2; -- compilation succeeds
> end T1;
> end Pak1;
The best solution is to avoid limited with:
with Pak2;
package Pak1 is
task type T1 is
entry E1 (T2 : Pak2.T2);
end T1;
end Pak1;
package body Pak1 is
task body T1 is
begin
accept E1 (T2 : Pak2.T2) do
T2.E2;
end E1;
end T1;
end Pak1;
--
Jeff Carter
"What I wouldn't give for a large sock with horse manure in it."
Annie Hall
42
next prev parent reply other threads:[~2013-07-26 20:49 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-26 19:14 Problem with limited with Simon Wright
2013-07-26 20:49 ` Jeffrey Carter [this message]
2013-07-26 22:17 ` Adam Beneschan
2013-07-26 22:25 ` Shark8
2013-07-26 22:35 ` Simon Wright
2013-07-27 0:17 ` Jeffrey Carter
2013-07-27 1:08 ` Adam Beneschan
2013-07-27 8:05 ` Simon Wright
2013-07-27 2:32 ` Shark8
2013-07-27 5:42 ` Jeffrey Carter
2013-07-27 16:00 ` Shark8
2013-07-27 17:13 ` Jeffrey Carter
2013-07-27 19:21 ` Simon Wright
2013-07-28 2:51 ` Randy Brukardt
2013-07-27 3:55 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox