Annotated Ada Reference Manual (Ada 202y Draft 1)Legal Information
Contents   Index   References   Search   Previous   Next 

8.5.5 Generic Renaming Declarations

1
[A generic_renaming_declaration is used to rename a generic unit.] 

Syntax

2/3
{AI05-0183-1} generic_renaming_declaration ::= 
    generic package defining_program_unit_name renames generic_package_name
        [aspect_specification];
  | generic procedure defining_program_unit_name renames generic_procedure_name
        [aspect_specification];
  | generic function defining_program_unit_name renames generic_function_name
        [aspect_specification];

Legality Rules

3
The renamed entity shall be a generic unit of the corresponding kind. 

Static Semantics

4
A generic_renaming_declaration declares a new view [of the renamed generic unit]. 
5/5
NOTE   {AI12-0440-1} Although the properties of the new view are the same as those of the renamed view, the place where the generic_renaming_declaration occurs can affect the legality of subsequent renamings and instantiations that denote the generic_renaming_declaration, in particular if the renamed generic unit is a library unit (see 10.1.1).

Examples

6
Example of renaming a generic unit: 
7
generic package Enum_IO renames Ada.Text_IO.Enumeration_IO;  -- see A.10.10

Extensions to Ada 83

7.a
Renaming of generic units is new to Ada 95. It is particularly important for renaming child library units that are generic units. For example, it might be used to rename Numerics.Generic_Elementary_Functions as simply Generic_Elementary_Functions, to match the name for the corresponding Ada-83-based package. 

Wording Changes from Ada 83

7.b
The information in RM83-8.6, “The Package Standard”, has been updated for the child unit feature, and moved to Annex A, except for the definition of “predefined type”, which has been moved to 3.2.1.

Extensions to Ada 2005

7.c/3
{AI05-0183-1} An optional aspect_specification can be used in a generic_renaming_declaration. This is described in 13.1.1

Contents   Index   References   Search   Previous   Next 
Ada-Europe Ada 2005 and 2012 Editions sponsored in part by Ada-Europe