From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 16 Feb 93 18:40:00 GMT From: eachus@mitre-bedford.arpa (Robert I. Eachus) Subject: Re: Ada Tasking & LRM Message-ID: List-Id: 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...