From: eachus@mitre-bedford.arpa (Robert I. Eachus)
Subject: Re: Ada Tasking & LRM
Date: 16 Feb 93 18:40:00 GMT [thread overview]
Message-ID: <EACHUS.93Feb16134000@goldfinger.mitre.org> (raw)
Section 9.4(1) says "Each task depends on at least one master.
A master is a construct that is either a task, a currently executing
block statement or subprogram, or a library package ( a package
declared within another program unit is not a master)."
The key is the words "at least one". If a task is declared
within a unit that is enclosed by (one or more) outer units, the outer
units will be masters (if they are not nested packages) whether or not
the innermost enclosing unit is a master. So the master of My_Task in
the first example is package One and there is no problem.
The reason the second example raises PROGRAM_ERROR has nothing to
do with this rule. The type a_task has not been and cannot be
elaborated before the creation of My_Task. (The elaboration of A_Type
happens in the body of One the ellaboration of My_Task in the spec.)
Note that one of the advantages of child packages in Ada 9X will
be that it will be possible to have a package which exports both a
task type and a child package containing an object of that type.
The usual Ada 83 solution for this sort of problem (in particular a
need to export both a private type and an object of that type) is to
use generics.
--
Robert I. Eachus
with Standard_Disclaimer;
use Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
reply other threads:[~1993-02-16 18:40 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