Language Change Specification for Protected Types with Generic Clause

LCS Number: LCS-2016-034
Version: 10 {10-Mar-2017}
9 {22-Feb-2017}
8 {21-Feb-2017}
7 {11-Feb-2017}
6 {13-Jan-2017}
5 {8-Jan-2017}
4 {6-Jan-2017}
3 {2-Jan-2017}
2 {30-Dec-2016}
1 {24-Dec-2016}
Date: 10-Mar-2017
Status: Voting
Author: Jim Lewis
Email: Main.JimLewis
Source Doc: Protected Types with Generic Clause
More Doc: history
Summary: Protected Types with Generic Clause

Voting Results: Cast your votes here

Yes:

  1. Jim Lewis - 2017-02-22 - ver 10
  2. Rob Gaddi - 2017-01-26 - ver 6
  3. Thomas Preusser - 2017-02-06 - ver 6
  4. Patrick Lehmann - 2017-02-22 - ver 9

No:

Abstain:

  1. Lieven Lemiengre - 2017-01-27
  2. Brent Hayhoe - 2017-02-16 Version 7 - Abstain due to lack of personal time for review.

Style Notes

Changes are shown in red font. Deletions are crossed out. Editing notes in green font.

Reviewing Notes

This LCS borrows heavily from the 1076-2008 addition of generics to packages and subprograms. See LCS-2006-133 and LCS-2006-134

Revision History

Revision 10: 10-Mar-2017
  • Modified last sentence of edit in 5th paragraph in 6.5.7.2 on page 84

Revision 9:

  • Revised elaboration of a variable with a generic map aspect
  • Revised new paragraph 2 of 6.4.2.4 Variable declarations
  • 14.4.2.3 added elaboration of a protected type instantiation declaration

Revision 8:

  • removed ; after pt instantiation definition
  • updated error text for variable with no generic associated
  • Added Examples

Revision 7:

  • Edited last two paragraphs of 6.5.4 on top of page 77
  • Edited last two paragraphs of 6.5.5 on bottom of page 77

Revision 6:

  • Changed 2nd paragraph of new paragraphs on p70 that become 2nd paragraph
    • defines variable with uninstantiated PT in terms of protected type instance declaration

Revision 5:

  • updated paragraph text that was added in 6.4.2.4 Variable declarations (becomes 2nd paragraph) to match what was done in protected type instantiation. Addresses where is generic-mapped protected type defined for variable declarations.
  • 5th paragraph in 6.5.7.2 on page 84
  • fixed highlighting and red text in 14.4.2.5 before the notes on page 208

Revision 4: (correlation with LCS-2006-0134)

  • Page 70, restrict generic_map_aspect to types that have a generic_clause
  • Page 79 note on bottom of page in 6.5.6.2
  • Page 84 Edit first paragraph. Added item to list
  • Page 186, list item f in 12.2 Scope of declarations
  • Page 208, edits to 14.4.2.5 Object declaration (in Elaboration)
  • Addition of Annex C
  • Addition of Annex I

Revision 3: Adding edits that were missed on the first two passes

  • Page 73, First paragraph of section 6.5.2
  • Page 75, First paragraph of section 6.5.3
  • Page 76, First paragraph of section 6.5.4
  • Page 77, First paragraph of section 6.5.5
  • Page 77, First paragraph of section 6.5.6.1
  • Third paragraph counting BNF as one paragraph in 6.5.7.1 page 81

Afterword Notes

Author Comments: The current proposal only adds generics to protected types. This allows a simplified approach to dealing the generic map aspect by adding it to variable declaration.

If generics are to be added to other types, such as records, this becomes a more complex problem. It would not be so bad if the already defined term subtype indication could be modified to accomodate a generic map aspect, however, a generic map aspect creates a new type, so this would not be appropriate. Hence, a new term, such as type indication would need to be introducted such as below:

type_indication ::=
      subtype_indication[ generic_map_aspect ]

A generic type cannot currently be a simple protected type, however, a generic type could be an uninstantiated protected type.

Comments

The big red block is quite long... Is it derived from an existing block for generics? If so, which LRM section? Can you please outline the applied changes made for protected types?

-- Patrick Lehmann - 2016-12-31

The addition of a generic map to a variable declaration is like adding array bounds. Does this mean that the uninstantiated protected type should be treated like an unconstrained array?

-- Peter Flake - 2016-12-31

@Patrick: In 2008, generics were added to packages and subprograms. This section templates using that.

-- Jim Lewis - 2017-01-02

@Peter: Yes. The intent is to give protected types defined in packages the same capability that a language defined construct (such as a list or associative array type).

-- Jim Lewis - 2017-01-02

Topic revision: r1 - 2017-07-16 - 06:40:20 - JimLewis
 
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback