Language Change Specification for Record Introspection & Indexing

Primary LCS:

This LCS details changes to a record declaration and selected name definition in order to provide introspection of record types.

LCS Number: LCS-2016-069a
Version: 1
Date: 13-Jan-17
Status: Draft
Author: Brent Hayhoe
Email:  
Source Doc: Record Introspection & Indexing
Summary: Definition of selected names to enable introspection of record types
Related LCS: LCS-2016-069b

Voting Results: Cast your votes here

  • Yes:
    1. Brent Hayhoe - 2017-01-13 - Version 1

  • Abstain:

Details of Language Change:

Key:

  • LRM text is shown between single quotes '... P1076 LRM quoted text ...'
  • Existing LRM text is shown in BLACK coloured font
  • Additional LRM text is shown in RED coloured font
  • Deleted LRM text is shown in RED with strike-through
  • In order to try and emphasize text in italic font:
    • Italic font in existing LRM text is shown in GRAY italic font
    • Italic font in new LRM text is shown in ORANGE italic font
    • Italic font in deleted LRM text is shown in ORANGE with strike-through
  • Editing instructions are shown in GREEN coloured font

Annot: how to access record element path with an enumeration type?

LRM 5.3.3 Record types

51 middle

Edit: Replace the BNF productions with:


record_type_definition ::=
     record
          element_declaration
          { element_declaration }
     end record [ record_type_simple_name ]

element_declaration ::=
     identifier_list : element_subtype_definition ;

identifier_list ::= identifier { , identifier }

element_subtype_definition ::= subtype_indication

record_constraint ::=
     ( record_element_constraint { , record_element_constraint } )

record_element_constraint ::= record_element_simple_name element_constraint

implicit_enumeration_type_definition ::=
     ( element_identifier_list { , element_identifier_list } )


Edit: After the paragraph beginning:

'An element declaration with several identifiers ...'

Edit: insert the following paragraph:

'An implicit enumeration type is declared whenever a record type is declared. Each enumeration literal of this enumeration type corresponds to one element identifier of the record type. The number of enumeration literals in the enumeration type shall be the same as the number of element identifiers in the record type.'

LRM 8.3 Selected names

page 109 top

Edit: Replace the BNF productions with:


selected_name ::= prefix . suffix

suffix ::=
     simple_name
   | character_literal
   | enumeration_identifier
   | operator_symbol
   | all


Edit: Replace the 2nd paragraph beginning:

'For a selected name that is used to denote a record element ...'

Edit: with the following paragraph:

'For a selected name that is used to denote a record element, the suffix shall be denoting the element of a record object or value shall be; a simple name denoting an element of a record object or value. an enumeration identifier literal of the implicit enumeration type associated with the record type. The prefix shall be appropriate for the type of this object or value.'

Comments

This proposal is based on the idea that these attributes can be used within a for-loop. The iterator of a for-loop is not locally static so it's unusable as an argument of an attribute. So, you can add these attributes but you will not achieve your usecase.

-- Lieven Lemiengre - 2017-01-09

Is this the same for arrays as well?

-- Brent Hayhoe - 2017-01-10

Edit | Attach | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r1 - 2017-01-13 - 01:08:48 - TWikiGuest
 
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback