comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen.leake@gsfc.nasa.gov>
Subject: Re: Problem with packages
Date: 1998/04/27
Date: 1998-04-27T00:00:00+00:00	[thread overview]
Message-ID: <3544BE8E.2F13@gsfc.nasa.gov> (raw)
In-Reply-To: 01bd706a$6007a540$db41a6c3@grat.softnet.co.uk


Sean kenny wrote:
> 
> can anyone tell us why this the following code won't compile
> we keep the following error message
> 
>  invalid prefix in selected component "working_hold"
> 
> on the indicated lines
> 
> hold_id is defined in the following package which compiles
> ok.

You've defined Hold_ID as a "limited private" type. This means client
packages (like gang) cannot access any elements of the type directly.

Either make the type not limited, or provide a function in package
foreman that gives you the access you need.

-- Stephe

> 
> WITH foreman;
> use foreman;
> 
> PACKAGE BODY gangs IS
> TASK body gang is
>   hold_state : work := more;
>   working_hold: hold_id;
> begin
>   foreman.request_work(working_hold);
>   WHILE hold_state = more loop
>   working_hold.next_container(hold_state);      <----
>   END loop;
> 
>   working_hold.complete;        <------
> end gang;
> 
> END gangs;
> 
> package foreman is
> 
> type work is (more, finished);
> type hold_id is limited private;
> 
> procedure request_work(this_hold : in out hold_id);
> private
> type hold;
> type hold_id is access hold;
> task type hold is
>  entry next_container(state : out work);
>  entry complete;
> end hold;
> end foreman;--
>




      parent reply	other threads:[~1998-04-27  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <01bd706a$6007a540$db41a6c3@grat.softnet.co.uk>
1998-04-25  0:00 ` Problem with packages Tucker Taft
1998-04-27  0:00 ` Samuel Mize
1998-04-27  0:00 ` Stephen Leake [this message]
replies disabled

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