Signatures Required in Association Lists

Proposal Details

  • Who Updates:main.CliffordWalinsky , main.JimLewis
  • Date Proposed:December 20, 2012
  • Date Last Updated:
  • Priority:
  • Complexity:
  • Focus:General Language

Summary

Provide a way to unambiguously associate subprograms or subprogram instances with overloaded interface subprograms within generic association lists.

Current Situation

Like other declarative regions, generic clauses create regions in which newly-declared interface subprograms can be overloaded.

Rules specified in the LRM for positionally associating actuals with formals are sufficient to determine which subprogram is to be associated with an overloaded interface subprogram. However, association by name requires additional rules to determine how a subprogram is associated with one of possibly many overloaded interface subprograms.

As an example consider the following generic clause:

generic( procedure foo(x : integer); procedure foo(x : bit) );

A generic map aspect using this clause, employing named association, could only specify the following ambiguous specification:

generic map( foo => foo_integer, foo => foo_bit )

where foo_integer and foo_bit are names of previously declared procedures visible at the point of the generic map. This generic map aspect violates the following condition of section 6.5.7.2:

"Similarly, for a formal generic type, a formal generic subprogram, or a formal generic package, it is an error if the formal is associated with more than one actual."

Candidate: Signatures in Generic Map Aspects

We propose to resolve the ambiguity of associating subprograms with overloaded interface subprograms by expanding the grammar of generic_association_list to permit an optional signature to be present following a generic name that designates an interface subprogram. The signature will describe the parameter and return-type profile of the designated interface subprogram.

In the prior example, the following generic map aspect will be specified:

generic map( foo [integer] => foo_integer, foo [bit] => foo_bit )

Use Cases

Arguments FOR

Arguments AGAINST

General Comments

Supporters

Add your signature here to indicate your support for the proposal

Edit | Attach | Print version | History: r5 | r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2012-12-13 - 22:35:55 - CliffordWalinsky
 
Copyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback