Paquetes como parámetros formales genéricos

Explicación

Una declaración formal de paquete declara que el paquete formal es una instancia de un paquete genérico dado. Se utiliza la palabra with precediendo al protocolo del paquete que se espera.

Sintaxis

formal_package_declaration ::=
   with package defining_identifier is new generic_package_name formal_package_actual_part;

formal_package_actual_part
::=
    ([others =>] <>)
  | [generic_actual_part]
  | (formal_package_association {, formal_package_association} [, others => <>])

formal_package_association
::=
    generic_association
  | generic_formal_parameter_selector_name
=> <>

Ejemplo

generic
   with package Bounded is
     new Ada.Strings.Bounded.Generic_Bounded_Length (<>);