To: J3 J3/19-249 From: Van Snyder Subject: Syntax for True Enumeration types Date: 2019-October-16 Reference: 19-231r2, 19-232 1. Syntax to define an enumeration type ======================================= 1.1 General idea [ PRIVATE ] 1.2 Begin and end type definition Based on ENUM in subclause 7.6 ENUM [[, INITIAL ( ] ::] ... END ENUM [ ] 1.3 Declare enumerators A statement to specify enumerator names ENUMERATOR [ [, ] :: ] & & [ , ] ... {Simply listing the names without a keyword does not work. In fixed form, or if the optional space in END TYPE is omitted, the ENDTYPE statement looks like just another enumerator.} 1.4 Declare default initial value On the statement that introduces the type definition ENUM [, INITIAL ( ), ] :: 2. Syntax to declare an object of enumeration type ================================================== TYPE ( ) [[ , ] :: ] [ = & & ] 3. Syntax to reference an enumerator ==================================== Straw vote on 19-231 was that enumerators are class (2) names. Therefore, the type name must always appear. Vauguely reminiscent of component selection % {We do not ever use " %" for anything.} 4. FIRST, LAST inquiry ====================== Vaguely reminiscent of type parameter inquiry % FIRST % LAST 5. NEXT, PREV as type-bound functions =========================================== NEXT and PREV are considered to be type-bound functions that are defined by the type definition, without bindings being declared. There is no syntax provided to declare procedure bindings. % NEXT ( [ [ STAT= ] ) % PREV ( [ [ STAT= ] )