
LCS2016018c 

3 {03Jan2017} 2 {04Jan2017} 1 {04Jan2017} 

04Jan2017 

Voting 

Jim Lewis 

Main.JimLewis 

Attributes for Enumerated Types 

Attributes for Enumerated Types 

LCS2016018  Attributes for Enumerated Types LCS2016018b  Algorithm to create object attributes 
Yes:
No:
1. Patrick Lehmann  20170110  as this LCS started as a fork to propose an alternative wording, I prefer the initial LCS number, which now merges all changes (LCS 018, 018b, 018c).
2. Kevin Jennings  20170111  Ver 3. Switched my 'Yes' vote to LCS 18 which merges LCS 18c back into LCS 18.
Abstain:
crossed out.
Editing notes in green font.
Each edit is identified separately with edit flag: Edit1a, Edit2, Edit3, Edit1b, Edit4, Edit5
You may reference these when voting if desired.
This LCS LCS2016_18c is in direct compilation / conflict with the attributes defined in:
It should also be noted that the above two bullet point items conflict with each other  so this LCS makes it as 3 way conflict  ie: 1 must be selected the others or items from the others must be deleted.
P 
Kind:  Type. 
Prefix:  Any prefix P that is appropriate for an object with type or subtype T, or an alias thereof, or that denotes any type or subtype T. 

Result:  The base type of T.  
Restrictions:  This attribute is allowed only as the prefix of the name of another attribute; for example, T'BASE'LEFT.  
P 
Kind:  Value. 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T. 

Result type:  Same type as T.  
Result:  The left bound of T.  
P 
Kind:  Value. 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T. 

Result type:  Same type as T.  
Result:  The right bound of T.  
P 
Kind:  Value. 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T. 

Result type:  Same type as T.  
Result:  The upper bound of T.  
P 
Kind: Value.  
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T. 

Result type:  Same type as T.  
Result:  The lower bound of T. 
[Edit2: Add new attributes as follows ]
T'LENGTH  Kind:  Pure function 
Prefix:  Any prefix P that is appropriate for an object with a discrete or physical type or subtype T, or an alias thereof, or that denotes any discrete or physical type or subtype T.  
Result type:  _universal_integer_.  
Result:  T'LENGTH = maximum(0, T'POS(T'HIGH)  T'POS(T'LOW) + 1)  
T'RANGE  Kind:  Range 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T.  
Result type:  The type of T.  
Result:  The range T'LEFT to T'RIGHT if the range of T is ascending, or the range T'LEFT downto T'RIGHT if the range of T is descending. 

T'REVERSE_RANGE  Kind:  Range 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T.  
Result type:  The type of T.  
Result:  The range T'RIGHT downto T'LEFT if the range of T is ascending, or the range T'RIGHT to T'LEFT if the range of T is descending. 

[Edit3: Add new POS_RANGE and POS_REVERSE_RANGE attribute as follows ]
T'POS_RANGE  Kind:  Range 
Prefix:  Any prefix P that is appropriate for an object with a discrete or physical type or subtype T, or an alias thereof, or that denotes any discrete or physical type or subtype T.  
Result type:  INTEGER.  
Result:  The range T'POS(T'LEFT) to T'POS(T'RIGHT) if the range of T is ascending, or the range T'POS(T'LEFT) downto T'POS(T'RIGHT) if the range of T is descending. 

T'POS_REVERSE_RANGE  Kind:  Range 
Prefix:  Any prefix P that is appropriate for an object with a discrete or physical type or subtype T, or an alias thereof, or that denotes any discrete or physical type or subtype T.  
Result type:  INTEGER.  
Result:  The range T'POS(T'RIGHT) downto T'POS(T'LEFT) if the range of T is ascending, or the range T'POS(T'RIGHT) to T'POS(T'LEFT) if the range of T is descending. 
[Edit1b: Edit existing attribute as follows ]
P 
Kind:  Value. 
Prefix:  Any prefix P that is appropriate for an object with a scalar type or subtype T, or an alias thereof, or that denotes any scalar type or subtype T. 

Result type:  Type BOOLEAN  
Result:  It is TRUE if T is defined with an ascending range; FALSE otherwise. 
[Edit 4: Insert each of the following attributes after the attribute with the same name]
O'IMAGE  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a scalar type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'IMAGE(O)  
O'POS  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a discrete or physical type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'POS(O)  
O'SUCC  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a discrete or physical type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'SUCC(O)  
O'PRED  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a discrete or physical type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'PRED(O)  
O'LEFTOF  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a discrete or physical type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'LEFTOF(O)  
O'RIGHTOF  Kind:  Pure function. 
Prefix:  Any prefix O that is appropriate a discrete or physical type or subtype, or an alias thereof  
Shorthand for:  O'SUBTYPE'RIGHTOF(O) 
[Edit 5: Edit Note 1 as below]
NOTE 1  The relationship between the values of the LEFT, RIGHT, LOW, and HIGH attributes is expressed as
follows:
Ascending range  Descending range  
P 
=  P 
P 
P 
=  P 
P 
 Overlaps with section 16.2.3
 Does not cover all of the attributes of 16.2.3
 Does not at all address the key contribution of LCS2016072a ( Attributes with Function Knows Vector Size) which is to define a mechanism within a subprogram to get at the declared range for the actual that is bound to the formal parameter.
 Since this LCS lacks a way for a subprogram to get at the attributes of the actual, it then limits the FunctionsKnowsVectorSize proposal (LCS2016072) since it would not allow for a function to determine the bounds of the target if that target happens to be a scalar.
 Merging a section that describes attributes of types with something that attempts to describe attributes of objects doesn't add any value over current LRM with LCS2016072a but that was NIH I suppose.
 Kevin Jennings  20170104
@KJ1: No. There is no overlap with 16.2.3. Section 16.2.3 applies to array types and objects of array types. These edits apply to scalar types (or a subset of scalar types) and objects of scalar types (or a subset of scalar types). Hence, while these edits make 16.2.2 and 16.2.3 converge in styles of defining the attributes for types and objects in the same place, they are nonoverlapping.
@KJ2: These are in LCS201618_alt which I am working on now. [Note: In version 2, these are included here and there is no "_alt" version]
@KJ3.1: This LCS is was developed based on Enumerated Attributes proposal.
@KJ3.2 Doing things with attributes in a subprogram (part of 72a) is a separate issue from creating additional attributes. Please separate your LCS 72a into 2 pieces. At this point we have 3 approaches for handling the attributes.
@KJ4: Same separate issue identified in @KJ3.2
@KJ5.1: The title of 16.2.2 is: "Predefined attributes of types and objects". Hence objects belong here. In addition, 16.2.3 is array types and objects, and the prefix in the revision of 16.2.2 makes both sections done in exactly the same style.
@KJ5.2 NIH never entered my mind. My biggest concern is getting these done correctly in a timely fashion. The attribute descriptions you provided in 72a are currently wrong.
Version 3: Removed the parameters from attributes as they don't belong in the short hand. Fixed color of P in P'LEFT, ...