From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.6 required=5.0 tests=BAYES_05,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c2d2708a248cb88 X-Google-Attributes: gid103376,public From: Stephen Leake Subject: Re: Problem with packages Date: 1998/04/27 Message-ID: <3544BE8E.2F13@gsfc.nasa.gov>#1/1 X-Deja-AN: 348151327 Content-Transfer-Encoding: 7bit References: <01bd706a$6007a540$db41a6c3@grat.softnet.co.uk> Content-Type: text/plain; charset=us-ascii Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: stephen.leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1998-04-27T00:00:00+00:00 List-Id: 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;-- >