DocAda(tm) is a productivity tool of KSCE

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

12.5.3 Formal Array Types

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

Syntax

   
       formal_array_type_definition ::= array_type_definition

Legality Rules

The only form of discrete_subtype_definition that is allowed within the declaration of a generic formal (constrained) array subtype is a subtype_mark.

For a formal array subtype, the actual subtype shall satisfy the following conditions:

Examples

Example of formal array types:

    
       --  given the generic package

       generic
          type Item   is private;
          type Index  is (<>);
          type Vector is array (Index range <>) of Item;
          type Table  is array (Index) of Item;
       package P is
          ...
       end P;

       --  and the types

       type Mix    is array (Color range <>) of Boolean;
       type Option is array (Color) of Boolean;

       --  then Mix can match Vector and Option can match Table

       package R is new P(Item   => Boolean, Index => Color,
                          Vector => Mix,     Table => Option);

       --  Note that Mix cannot match Table and Option cannot match Vector

About DocAda Light: Preface / Preliminary / Help / TOC / Copyright
DocAda Online at the Ada Home: Complete RM95 / Updates / News
Prev | Up | Next | 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