DocAda(tm) is a productivity tool of KSCE

Prev | Up | ____ | Back | Forward
About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News

12.5.4 Formal Access Types

The class determined for a formal access type is the class of all access types.

Syntax

   
       formal_access_type_definition ::= access_type_definition

Legality Rules

For a formal access-to-object type, the designated subtypes of the formal and actual types shall statically match.

If and only if the general_access_modifier constant applies to the formal, the actual shall be an access-to-constant type. If the general_access_modifier all applies to the formal, then the actual shall be a general access-to-variable type (see 3.10).

For a formal access-to-subprogram subtype, the designated profiles of the formal and the actual shall be mode-conformant, and the calling convention of the actual shall be protected if and only if that of the formal is protected.

Examples

Example of formal access types:

   
       --  the formal types of the generic package

       generic
          type Node is private;
          type Link is access Node;
       package P is
          ...
       end P;

       --  can be matched by the actual types

       type Car;
       type Car_Name is access Car;

       type Car is
          record
             Pred, Succ : Car_Name;
             Number     : License_Number;
             Owner      : Person;
          end record;

       --  in the following generic instantiation

       package R is new P(Node => Car, Link => Car_Name);

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | ____ | Back | Forward


Copyright © 1994-1997 by Kempe Software Capital Enterprises. All Rights Reserved. For comments on this DocAda(tm) hypertext document, please write to KSCE, at docada@ksce.com