CVS difference for ai12s/ai12-0020-1.txt
--- ai12s/ai12-0020-1.txt 2019/01/04 23:03:36 1.17
+++ ai12s/ai12-0020-1.txt 2019/02/16 04:36:16 1.18
@@ -1,11 +1,29 @@
-!standard 4.10(0) 19-01-04 AI12-0020-1/08
+!standard 4.10(0) 19-02-14 AI12-0020-1/09
!standard 3.5(27.1/2)
+!standard 3.5(27.2/2)
+!standard 3.5(27.3/2)
+!standard 3.5(27.4/2)
+!standard 3.5(27.5/2)
+!standard 3.5(27.6/2)
+!standard 3.5(27.7/2)
+!standard 3.5(28)
+!standard 3.5(29)
+!standard 3.5(30/3)
+!standard 3.5(31)
+!standard 3.5(32)
+!standard 3.5(33/3)
+!standard 3.5(37.1/2)
+!standard 3.5(38)
+!standard 3.5(39)
+!standard 3.5(43/3)
+!standard 3.5(55/3)
!standard 3.5(55.1/5)
-!standard 3.5(55.2/5)
-!standard 3.5(55.3/5)
-!standard 3.5(55.4/5)
-!standard 13.13.1(9)
-!standard 13.13.1(11)
+!standard 3.5(55.2/4)
+!standard 3.5(55.3/4)
+!standard 3.5(55.4/4)
+!standard 3.5(59)
+!standard H.4(23)
+!standard H.4(23.8/2)
!class Amendment 12-02-14
!status Amendment 1-2012 18-11-27
!status ARG Approved 8-0-0 18-10-22
@@ -51,9 +69,10 @@
For scalars - the same image that Wide_Wide_Image already generated before
this AI.
For access types -
- Integer value displayed as a hex digits preceded by an '@',
- except null displayed as "NULL". Number of hex digits determined
- by size of access type. For example, "@FF0012AC".
+ An implementation-defined string preceded by "(ACCCES",
+ except null displayed as "NULL". The intent is that these would
+ normally be a hex representation of the access value.
+ For example, "(ACCESS FF0012AC)".
For task types -
Undiscriminated: "(TASK <task_id_image>)"
Discriminated: "(TASK <task_id_image> with D1 => 123, D2 => 456)"
@@ -90,7 +109,7 @@
Delete 3.5(27.1/2 - 37.a/2, 55.1/5-55.4/4)
-In 3.5(37.12, 38, and 39), replace the three occurrences of
+In 3.5(37.1/2, 38, and 39), replace the three occurrences of
"over all values of the subtype S"
with
"over all values of the subtype S, assuming a default
@@ -102,6 +121,14 @@
"(or corresponds to the result of S'Image for a value of the type,
assuming a default implementation of S'Put_Image)".
+Modify 3.5(59):
+
+For any value V (including any nongraphic character) of an enumeration
+subtype S {without a specified Put_Image (see 4.10)}, S'Value(S'Image(V))
+equals V, as do S'Wide_Value(S'Wide_Image(V)) and
+S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions ever
+raise Constraint_Error.
+
====
Add a new subclause
@@ -111,7 +138,7 @@
Static Semantics
For every subtype S of a non-universal type T, the following
- type-related operational attributes are defined:
+ type-related operational attribute is defined:
S'Put_Image
S'Put_Image denotes a procedure with the following specification:
@@ -135,40 +162,6 @@
terms of calls to the corresponding Put_Image procedure, so changes
in their behavior may be accomplished via a Put_Image specification.
- S'Wide_Wide_Image
-
- S'Wide_Wide_Image denotes a function with the following specification:
- function S'Wide_Wide_Image (Arg : S'Base) return Wide_Wide_String
-
- The implementation of S'Wide_Wide_Image calls S'Put_Image
- (which will typically write a sequence of Wide_Wide_Character values
- out to a stream) and then returns the result of reading the contents
- of that stream via Wide_Wide_String'Read; the lower bound of that
- result is 1.
-
- S'Wide_Image
- S'Wide_Image denotes a function with the following specification:
- function S'Wide_Image (Arg : T) return Wide_String
-
- The function returns an image of the value of Arg as a Wide_String.
- The lower bound of the result is one. The image has the same sequence
- of graphic characters as defined for S'Wide_Wide_Image if all the
- graphic characters are defined in Wide_Character; otherwise, the
- sequence of characters is implementation defined (but no shorter
- than that of S'Wide_Wide_Image for the same value of Arg).
-
- S'Image
- S'Image denotes a function with the following specification:
- function S'Image(Arg : S'Base) return String
-
- The function returns an image of the value of Arg as a String.
- The lower bound of the result is one. The image has the same
- sequence of graphic characters as that defined for S'Wide_Wide_Image
- if all the graphic characters are defined in Character; otherwise,
- the sequence of characters is implementation defined (but no shorter
- than that of S'Wide_Wide_Image for the same value of Arg).
-
-
The behavior of the default implementation of S'Put_Image depends
on the class of T. For an elementary type, the implementation is
equivalent to
@@ -380,6 +373,44 @@
AARM note: If T is an unchecked union type, then the default
implementation of T'Put_Image will raise Program_Error.
+For every subtype S of a type T, the following attributes are defined:
+
+ S'Wide_Wide_Image
+
+ S'Wide_Wide_Image denotes a function with the following specification:
+ function S'Wide_Wide_Image (Arg : S'Base) return Wide_Wide_String
+
+ S'Wide_Wide_Image calls S'Put_Image passing Arg
+ (which will typically write a sequence of Wide_Wide_Character values
+ out to a stream) and then returns the result of reading the contents
+ of that stream via Wide_Wide_String'Read; the lower bound of that
+ result is 1.
+
+ S'Wide_Image
+ S'Wide_Image denotes a function with the following specification:
+ function S'Wide_Image (Arg : T) return Wide_String
+
+ The function returns the result of a call on S'Wide_Wide_Image
+ with a parameter of Arg as a Wide_String. The lower bound of the result is
+ one. The result has the same sequence of graphic characters as that
+ returned by S'Wide_Wide_Image if all the graphic characters are
+ defined in Wide_Character; otherwise, the sequence of characters is
+ implementation defined (but no shorter than that of S'Wide_Wide_Image
+ for the same value of Arg).
+
+ S'Image
+ S'Image denotes a function with the following specification:
+ function S'Image(Arg : S'Base) return String
+
+ The function returns the result of a call on S'Wide_Wide_Image
+ with a parameter of Arg as a String. The lower bound of the result is
+ one. The result has the same sequence of graphic characters as that
+ returned by S'Wide_Wide_Image if all the graphic characters are
+ defined in Character; otherwise, the sequence of characters is
+ implementation defined (but no shorter than that of S'Wide_Wide_Image
+ for the same value of Arg).
+
+
For a prefix X that denotes an object of a non-universal type T, the following
attributes are defined:
X'Wide_Wide_Image
@@ -435,7 +466,7 @@
"(F1 | F2 => TRUE)" instead of "(F1 => TRUE, F2 => TRUE)".]
- Additional spaces, carriage returns, and line feeds (Wide_Wide_Characters
- with positions 32, 10, and 13, may be inserted
+ with positions 32, 10, and 13), may be inserted
to improve readability of the generated image.
Add after H.4(23):
@@ -679,6 +710,490 @@
bounded error. Constraint_Error or Program_Error may be propagated,
or an implementation defined result may be returned.
+!corrigendum 3.5(27.1/2)
+
+@ddel
+@xhang<@xterm<S'Wide_Wide_Image>
+S'Wide_Wide_Image denotes a function with the following specification:>
+
+!corrigendum 3.5(27.2/2)
+
+@ddel
+@xcode< @b<function> S'Wide_Wide_Image(@i<Arg> : S'Base)
+ @b<return> Wide_Wide_String>
+
+!corrigendum 3.5(27.3/2)
+
+@ddel
+@xindent<The function returns an @i<image> of the value of @i<Arg>, that is, a
+sequence of characters representing the value in display form. The lower bound
+of the result is one.>
+
+!corrigendum 3.5(27.4/2)
+
+@ddel
+@xindent<The image of an integer value is the corresponding decimal literal,
+without underlines, leading zeros, exponent, or trailing spaces, but with a
+single leading character that is either a minus sign or a space.>
+
+!corrigendum 3.5(27.5/2)
+
+@ddel
+@xindent<The image of an enumeration value is either the corresponding
+identifier in upper case or the corresponding character literal (including the
+two apostrophes); neither leading nor trailing spaces are included. For a
+@i<nongraphic character> (a value of a character type that has no enumeration
+literal associated with it), the result is a corresponding language-defined
+name in upper case (for example, the image of the nongraphic character
+identified as @i<nul> is "NUL" @emdash the quotes are not part of the image).>
+
+!corrigendum 3.5(27.6/2)
+
+@ddel
+@xindent<The image of a floating point value is a decimal real literal best
+approximating the value (rounded away from zero if halfway between) with a
+single leading character that is either a minus sign or a space, a single digit
+(that is nonzero unless the value is zero), a decimal point, S'Digits@endash1 (see
+3.5.8) digits after the decimal point (but one if S'Digits is one), an upper
+case E, the sign of the exponent (either + or @endash), and two or more digits (with
+leading zeros if necessary) representing the exponent. If S'Signed_Zeros is
+True, then the leading character is a minus sign for a negatively signed zero.>
+
+!corrigendum 3.5(27.7/2)
+
+@ddel
+@xindent<The image of a fixed point value is a decimal real literal best
+approximating the value (rounded away from zero if halfway between) with a
+single leading character that is either a minus sign or a space, one or more
+digits before the decimal point (with no redundant leading zeros), a decimal
+point, and S'Aft (see 3.5.10) digits after the decimal point.>
+
+!corrigendum 3.5(28)
+
+@ddel
+@xhang<@xterm<S'Wide_Image>
+S'Wide_Image denotes a function with the following specification:>
+
+!corrigendum 3.5(29)
+
+@ddel
+@xcode< @b<function> S'Wide_Image(@i<Arg> : S'Base)
+ @b<return> Wide_String>
+
+!corrigendum 3.5(30/3)
+
+@ddel
+@xindent<The function returns an image of the value of @i<Arg> as a Wide_String.
+The lower bound of the result is one. The image has the same sequence of
+graphic characters as defined for S'Wide_Wide_Image if all the graphic characters are
+defined in Wide_Character; otherwise, the sequence of characters is
+implementation defined (but no shorter than that of S'Wide_Wide_Image for the
+same value of Arg).>
+
+!corrigendum 3.5(35)
+
+@ddel
+@xhang<@xterm<S'Image>
+S'Image denotes a function with the following specification:>
+
+!corrigendum 3.5(36)
+
+@ddel
+@xcode< @b<function> S'Image(@i<Arg> : S'Base)
+ @b<return> String>
+
+!corrigendum 3.5(37/3)
+
+@ddel
+@xindent<The function returns an image of the value of @i<Arg> as a String. The
+lower bound of the result is one. The image has the same sequence of graphic
+characters as that defined for S'Wide_Wide_Image if all the graphic characters
+are defined in Character; otherwise, the sequence of characters is
+implementation defined (but no shorter than that of S'Wide_Wide_Image for the
+same value of @i<Arg>).>
+
+!corrigendum 3.5(37.1/2)
+
+@drepl
+@xhang<@xterm<S'Wide_Wide_Width>S'Wide_Wide_Width denotes the maximum length of
+a Wide_Wide_String returned by S'Wide_Wide_Image over all values of the subtype
+S. It denotes zero for a subtype that has a null range. Its type is
+@i<universal_integer>.>
+@dby
+@xhang<@xterm<S'Wide_Wide_Width>S'Wide_Wide_Width denotes the maximum length of
+a Wide_Wide_String returned by S'Wide_Wide_Image over all values of the subtype
+S, assuming a default implementation of S'Put_Image. It denotes zero for a
+subtype that has a null range. Its type is @i<universal_integer>.>
+
+!corrigendum 3.5(38)
+
+@drepl
+@xhang<@xterm<S'Wide_Width>S'Wide_Width denotes the maximum length of a
+Wide_String returned by S'Wide_Image over all values of the subtype S. It
+denotes zero for a subtype that has a null range. Its type is
+@i<universal_integer>.>
+@dby
+@xhang<@xterm<S'Wide_Width>S'Wide_Width denotes the maximum length of a
+Wide_String returned by S'Wide_Image over all values of the subtype S,
+assuming a default implementation of S'Put_Image. It denotes zero for a
+subtype that has a null range. Its type is @i<universal_integer>.>
+
+!corrigendum 3.5(39)
+
+@drepl
+@xhang<@xterm<S'Width>S'Width denotes the maximum length of a String returned
+by S'Image over all values of the subtype S. It denotes zero for a subtype
+that has a null range. Its type is @i<universal_integer>.>
+@dby
+@xhang<@xterm<S'Width>S'Width denotes the maximum length of a String returned
+by S'Image over all values of the subtype S, assuming a default
+implementation of S'Put_Image. It denotes zero for a subtype
+that has a null range. Its type is @i<universal_integer>.>
+
+!corrigendum 3.5(43/3)
+
+@drepl
+@xindent<For the evaluation of a call on S'Wide_Value for an enumeration
+subtype S, if the sequence of characters of the parameter (ignoring leading
+and trailing spaces) has the syntax of an enumeration literal and if it
+corresponds to a literal of the type of S (or corresponds to the result of
+S'Wide_Image for a value of the type), the result is the corresponding
+enumeration value; otherwise, Constraint_Error is raised. For a numeric
+subtype S, the evaluation of a call on S'Wide_Value with @i<Arg> of type Wide_String
+is equivalent to a call on S'Wide_Wide_Value for a corresponding @i<Arg> of type
+Wide_Wide_String.>
+@dby
+@xindent<For the evaluation of a call on S'Wide_Value for an enumeration
+subtype S, if the sequence of characters of the parameter (ignoring leading
+and trailing spaces) has the syntax of an enumeration literal and if it
+corresponds to a literal of the type of S (or corresponds to the result of
+S'Wide_Image for a value of the type,
+assuming a default implementation of S'Put_Image), the result is the corresponding
+enumeration value; otherwise, Constraint_Error is raised. For a numeric
+subtype S, the evaluation of a call on S'Wide_Value with @i<Arg> of type Wide_String
+is equivalent to a call on S'Wide_Wide_Value for a corresponding @i<Arg> of type
+Wide_Wide_String.>
+
+!corrigendum 3.5(55/3)
+
+@drepl
+@xindent<For the evaluation of a call on S'Value for an enumeration
+subtype S, if the sequence of characters of the parameter (ignoring leading
+and trailing spaces) has the syntax of an enumeration literal and if it
+corresponds to a literal of the type of S (or corresponds to the result of
+S'Image for a value of the type), the result is the corresponding
+enumeration value; otherwise, Constraint_Error is raised. For a numeric
+subtype S, the evaluation of a call on S'Value with @i<Arg> of type String
+is equivalent to a call on S'Wide_Wide_Value for a corresponding @i<Arg> of type
+Wide_Wide_String.>
+@dby
+@xindent<For the evaluation of a call on S'Value for an enumeration
+subtype S, if the sequence of characters of the parameter (ignoring leading
+and trailing spaces) has the syntax of an enumeration literal and if it
+corresponds to a literal of the type of S (or corresponds to the result of
+S'Image for a value of the type,
+assuming a default implementation of S'Put_Image), the result is the corresponding
+enumeration value; otherwise, Constraint_Error is raised. For a numeric
+subtype S, the evaluation of a call on S'Value with @i<Arg> of type String
+is equivalent to a call on S'Wide_Wide_Value for a corresponding @i<Arg> of type
+Wide_Wide_String.>
+
+!corrigendum 3.5(55.1/4)
+
+@ddel
+For a @fa<prefix> X that denotes an object of a scalar type (after any
+implicit dereference), the following attributes are defined:
+
+!corrigendum 3.5(55.2/4)
+
+@ddel
+@xhang<@xterm<X'Wide_Wide_Image>
+X'Wide_Wide_Image denotes the result of calling function
+S'Wide_Wide_Image with @i<Arg> being X, where S is the nominal
+subtype of X.>
+
+!corrigendum 3.5(55.3/4)
+
+@ddel
+@xhang<@xterm<X'Wide_Image>
+X'Wide_Image denotes the result of calling function S'Wide_Image
+with @i<Arg> being X, where S is the nominal subtype of X.>
+
+!corrigendum 3.5(55.4/4)
+
+@ddel
+@xhang<@xterm<X'Image>
+X'Image denotes the result of calling function S'Image with @i<Arg>
+being X, where S is the nominal subtype of X.>
+
+
+!corrigendum 3.5(59)
+
+@drepl
+@xindent<@s9<29 For any value V (including any nongraphic character) of an
+enumeration subtype S, S'Value(S'Image(V))
+equals V, as do S'Wide_Value(S'Wide_Image(V)) and
+S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions ever raise
+Constraint_Error.>>
+@dby
+@xindent<@s9<29 For any value V (including any nongraphic character) of an
+enumeration subtype S without a specified Put_Image (see 4.10), S'Value(S'Image(V))
+equals V, as do S'Wide_Value(S'Wide_Image(V)) and
+S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions ever raise
+Constraint_Error.>>
+
+
+!corrigendum 4.10(0)
+
+@dinsc
+
+@s8<@i<Static Semantics>>
+
+For every subtype S of a non-universal type T, the following
+type-related operational attribute is defined:
+
+@xhang<@xterm<S'Put_Image>
+S'Put_Image denotes a procedure with the following specification:>
+
+@xcode< @b<procedure> S'Put_Image
+ (@ft<@i<Arg>> : @b<in> T;
+ @ft<@i<Stream>> : @b<not null access> Ada.Streams.Root_Stream_Type'Class);>
+
+@xindent<The default implementation of S'Put_Image writes
+(using Wide_Wide_String'Write)
+an @i<image> of the value of @i<Arg>; that is, a Wide_Wide_String
+representing the value in display form.>
+
+@xindent<The Put_Image attribute may be specified for any specific
+type T either via an @fa<attribute_definition_clause> or via an
+@fa<aspect_specification> specifying the Put_Image aspect of the type.>
+
+The behavior of the default implementation of S'Put_Image depends
+on the class of T. For an elementary type, the implementation is
+equivalent to:
+@xcode<@b<procedure> Scalar_Type'Put_Image
+ (Arg : Scalar_Type; Stream : @b<access> Ada.Streams.Root_Stream_Type'Class) @b<is>
+@b<begin>
+ Wide_Wide_String'Write (@i<<described below@>>, Stream);
+@b<end> Scalar_Type'Put_Image;>
+where the Wide_Wide_String value written out to the stream is
+defined as follows:
+
+For an integer type, the image written out is the corresponding
+decimal literal, without underlines, leading zeros, exponent, or
+trailing spaces, but with a single leading character that is either
+a minus sign or a space.
+
+For an enumeration type, the image written out is either the
+corresponding identifier in upper case or the corresponding character
+literal (including the two apostrophes); neither leading nor trailing
+spaces are included. For a @i<nongraphic character> (a value of a character
+type that has no enumeration literal associated with it), the value is
+a corresponding language-defined name in upper case (for example,
+the image of the nongraphic character identified as @i<nul> is @fc<"NUL">
+@emdash the quotes are not part of the image).
+
+For a floating point type, the image written out is a decimal real
+literal best approximating the value (rounded away from zero if
+halfway between) with a single leading character that is either a minus
+sign or a space, a single digit (that is nonzero unless the value is
+zero), a decimal point, S'Digits-1 (see 3.5.8) digits after the
+decimal point (but one if S'Digits is one), an upper case E, the sign
+of the exponent (either + or -), and two or more digits (with leading
+zeros if necessary) representing the exponent. If S'Signed_Zeros is
+True, then the leading character is a minus sign for a negatively
+signed zero.
+
+For a fixed point type, the image written out is a decimal real literal
+best approximating the value (rounded away from zero if halfway between)
+with a single leading character that is either a minus sign or a space,
+one or more digits before the decimal point (with no redundant leading
+zeros), a decimal point, and S'Aft (see 3.5.10) digits after the
+decimal point.
+
+For an access type (named or anonymous), the image written out
+depends on whether the value is @b<null>. If it is @b<null>, then the
+image is @fc<"NULL">. Otherwise the image is a left parenthesis
+followed by @fc<"ACCESS">, a space, and a sequence of graphic
+characters, other than space or right parenthesis, representing the
+location of the designated object, followed by a right parenthesis,
+as in @fc<"(ACCESS FF0012AC)">.
+
+For an array type T, the default implementation of T'Put_Image
+generates an image based on (named, not positional) array aggregate
+syntax (with '[' and ']' as the delimiters) using calls to the
+Put_Image procedures of the index type(s) and the element type to
+generate images for values of those types.
+
+The case of a null array is handled specially, using ranges for
+index bounds and @fc<"<@>"> as a syntactic component-value placeholder.
+
+The order in which components are written for
+a composite type is the same canonical order in
+which components of a composite type T are written out
+by the default implementation of T'Write. This is also the
+order that is used in determining the meaning of a positional aggregate
+of type T.
+
+For a class-wide type, the default implementation of T'Put_Image
+generates an image based on qualified expression syntax.
+Wide_Wide_String'Write is called with Wide_Wide_Expanded_Name of
+@i<Arg>'Tag. Then S'Put_Image is called, where S is the specific type
+identified by @i<Arg>'Tag.
+
+For a type extension, the default implementation of T'Put_Image
+depends on whether there exists a noninterface ancestor of T (other
+than T itself) for which the Put_Image aspect has been
+explicitly specified. If so, then T'Put_Image will
+generate an image based on extension aggregate syntax where the
+ancestor type of the extension aggregate is the nearest ancestor type
+whose Put_Image aspect has been specified.
+
+If no such ancestor exists, then the default implementation of T'Put_Image
+is the same as described below for an untagged record type.
+
+For an untagged record type, a specific tagged record type other than
+a type extension which meets the criteria described in the previous
+paragraph, or a protected type, the default implementation of
+T'Put_Image generates an image based on (named, not positional) record
+aggregate syntax (except that for a protected type, the initial left
+parenthesis is followed by @fc<"PROTECTED with ">).
+Component names are displayed in upper case, following the rules for the
+image of an enumeration value. Component values are displayed via calls to
+the component type's Put_Image procedure.
+
+The image written out for a record having no components (including
+any interface type) is @fc<"(NULL RECORD)">. The image written out for a
+componentless protected type is @fc<"(PROTECTED NULL RECORD)">.
+In the case of a protected type T, a call to the default implementation
+of T'Put_Image begins only one protected (read-only) action.
+
+For an undiscriminated task type, the default implementation of T'Put_Image
+generates an image of the form @fc<"(TASK <task_id_image@>)">
+where <task_id_image> is the result obtained by calling
+Task_Identification.Image with the id of the given task
+and then passing that String to Characters.Conversions.To_Wide_Wide_String.
+
+For a discriminated task type, the default implementation of T'Put_Image
+also includes discriminant values, as in:
+
+@xcode<"(TASK <task_id_image@> with D1 =@> 123, D2 =@> 456)">
+
+For every subtype S of a type T, the following attributes are defined:
+
+@xhang<@xterm<S'Wide_Wide_Image>
+S'Wide_Wide_Image denotes a function with the following specification:>
+
+@xcode< @b<function> S'Wide_Wide_Image(@ft<@i<Arg>> : S'Base)
+ @b<return> Wide_Wide_String>
+
+@xindent<S'Wide_Wide_Image calls S'Put_Image
+passing @i<Arg> (which will typically write a sequence of Wide_Wide_Character
+values out to a stream) and then returns the result of reading the contents
+of that stream via Wide_Wide_String'Read. The lower bound of the
+result is 1.>
+
+@xhang<@xterm<S'Wide_Image>
+S'Wide_Image denotes a function with the following specification:>
+
+@xcode< @b<function> S'Wide_Image(@ft<@i<Arg>> : S'Base)
+ @b<return> Wide_String>
+
+@xindent<The function returns the result of a call on S'Wide_Wide_Image
+with a parameter of @i<Arg> as a Wide_String. The lower bound of the result is
+one. The result has the same sequence of graphic characters as that
+returned by S'Wide_Wide_Image if all the graphic characters are
+defined in Wide_Character; otherwise, the sequence of characters is
+implementation defined (but no shorter than that of S'Wide_Wide_Image
+for the same value of @i<Arg>).>
+
+@xhang<@xterm<S'Image>
+S'Image denotes a function with the following specification:>
+
+@xcode< @b<function> S'Image(@ft<@i<Arg>> : S'Base)
+ @b<return> String>
+
+@xindent<The function returns the result of a call on S'Wide_Wide_Image
+with a parameter of @i<Arg> as a String. The lower bound of the result is
+one. The result has the same sequence of graphic characters as that
+returned by S'Wide_Wide_Image if all the graphic characters are
+defined in Character; otherwise, the sequence of characters is
+implementation defined (but no shorter than that of S'Wide_Wide_Image
+for the same value of @i<Arg>).>
+
+For a @fa<prefix> X that denotes an object of a non-universal type T, the
+following attributes are defined:
+@xhang<@xterm<X'Wide_Wide_Image>
+X'Wide_Wide_Image denotes the result of calling function
+S'Wide_Wide_Image with @i<Arg> being X, where S is the nominal
+subtype of X.>
+@xhang<@xterm<X'Wide_Image>
+X'Wide_Image denotes the result of calling function S'Wide_Image
+with @i<Arg> being X, where S is the nominal subtype of X.>
+@xhang<@xterm<X'Image>
+X'Image denotes the result of calling function S'Image with @i<Arg>
+being X, where S is the nominal subtype of X.>
+
+
+@s8<@i<Implementation Permissions>>
+
+An implementation may transform the image generated by the default
+implementation of S'Put_Image for a composite subtype S in the
+following ways:
+
+@xbullet<If S is a composite subtype, the leading character of the image of
+a component value or index value is a space, and the immediately
+preceding character is an open parenthesis or bracket, then the space may
+be omitted. The same transformation is also permitted if the leading
+character of the component image is a space (in which case one of
+the two spaces may be omitted).>
+
+@xbullet<If S is an array subtype, the low bound of the array in each dimension
+equals the low bound of the corresponding index subtype, and the
+array value is not a null array value, then positional array
+aggregate syntax may be used.>
+
+@xbullet<If S is an array subtype and the given value can be displayed using
+@fa<named_array_aggregate> syntax where some @fa<discrete_choice_list> identifies
+more than one index value by identifying a sequence of one or more
+ranges and values separated by vertical bars, then this
+image may be generated instead; this may involve the reordering of
+component values.>
+
+@xbullet<Similarly, if S is a record subtype (or a discriminated type) and the
+given value can be displayed using named component association syntax
+where the length of some component_choice_list is greater than one,
+then this image may be generated instead; this may involve the
+reordering of component values.>
+
+@xbullet<Additional spaces, carriage returns, and line feeds (Wide_Wide_Characters
+with positions 32, 10, and 13), may be inserted
+to improve readability of the generated image.>
+
+!corrigendum H.4(23)
+
+@dinsa
+@xhang<@xterm<No_Reentrancy>During the execution of a subprogram by a task,
+no other task invokes the same subprogram.>
+@dinss
+@s8<@i<Dynamic Semantics>>
+
+The following @i<restriction_parameter_>@fa<identifier> is language defined:
+
+@xhang<@xterm<Max_Image_Length>
+Specifies the maximum length for a Wide_Wide_Image attribute result.
+Violation of this restriction results in the raising of
+Program_Error at the point of the invocation of an image attribute.>
+
+!corrigendum H.4(23.8/2)
+
+@dinsa
+@xbullet<Max_Tasks => 0.>
+@dinst
+If a Max_Image_Length restriction applies to any compilation unit in
+the partition, then for any subtype S, S'Wide_Wide_Image shall be
+implemented within that partition without any dynamic allocation.
+
!ACATS test
** TBD.
@@ -3495,6 +4010,169 @@
> makes more sense as an AARM implementation note.
Agreed.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, February 14, 2019 9:36 PM
+
+For the record:
+
+The first bullet of the Implementation Permission reads:
+
+If S is a composite subtype, the leading character of the image of a component
+value or index value is a space, and the immediately preceding character is an
+open parenthesis, then the space may be omitted. The same transformation is
+also permitted if the leading character of the component image is a space (in
+which case one of the two spaces may be omitted).
+
+which is interesting because we require arrays to be generated with square
+brackets. So apparently, we can't use this permission on an array aggregate.
+We clearly need to allow brackets here!
+
+If S is a composite subtype, the leading character of the image of a component
+value or index value is a space, and the immediately preceding character is an
+open parenthesis {or bracket}, then the space may be omitted. The same
+transformation is also permitted if the leading character of the component
+image is a space (in which case one of the two spaces may be omitted).
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, February 14, 2019 11:29 PM
+
+Another For the Record:
+
+There is a note at the end of 3.5 that says:
+
+For any value V (including any nongraphic character) of an enumeration subtype
+S, S'Value(S'Image(V)) equals V, as do S'Wide_Value(S'Wide_Image(V)) and
+S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions ever raise
+Constraint_Error.
+
+This is clearly a lie: all I need to do to make this False is:
+ type Bad is (...)
+ with Put_Image => Silly;
+ procedure Silly (Arg : in Bad; not null access
+Ada.Streams.Root_Stream_Type'Class) is
+ begin
+ raise Constraint_Error;
+ end Silly;
+
+So we need to mention that the Put_Image is the default:
+
+For any value V (including any nongraphic character) of an enumeration
+subtype S {without a specified Put_Image (see 4.10)}, S'Value(S'Image(V))
+equals V, as do S'Wide_Value(S'Wide_Image(V)) and
+S'Wide_Wide_Value(S'Wide_Wide_Image(V)). None of these expressions ever raise
+Constraint_Error.
+
+Arguably, this note belongs more in 4.10, but until we support a matching
+'Value, there is no obvious place for it. So it can stay here for Ada 2020.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Thursday, February 14, 2019 11:41 PM
+
+nother minor issue:
+
+The lead in for Put_Image and the Image family is:
+
+For every subtype S of a non-universal type T, the following type-related
+operational attributes are defined:
+
+But the Image attributes aren't redefinable, so calling them "operational
+attributes" is dubious.
+
+So I split the headers, into separate ones for Put_Image and Image.
+
+Once that was done, there was no remaining reason to leave the definition of
+Image in between the definition of the Put_Image attribute and the several
+pages of text defining its default behavior. Moving the Image attributes down
+puts that text together.
+
+This of course assumes that we agree on some introductory text for this
+subclause (else the point of the subclause won't show up until the last page),
+but I don't think that is optional anyway.
+
+****************************************************************
+
+From: Randy Brukardt
+Sent: Friday, February 15, 2019 12:59 AM
+
+The current description of the Image attributes is:
+
+ S'Wide_Wide_Image
+
+ S'Wide_Wide_Image denotes a function with the following specification:
+ function S'Wide_Wide_Image (Arg : S'Base) return Wide_Wide_String
+
+ The implementation of S'Wide_Wide_Image calls S'Put_Image
+ (which will typically write a sequence of Wide_Wide_Character values
+ out to a stream) and then returns the result of reading the contents
+ of that stream via Wide_Wide_String'Read; the lower bound of that
+ result is 1.
+
+ S'Wide_Image
+ S'Wide_Image denotes a function with the following specification:
+ function S'Wide_Image (Arg : T) return Wide_String
+
+ The function returns an image of the value of Arg as a Wide_String.
+ The lower bound of the result is one. The image has the same sequence
+ of graphic characters as defined for S'Wide_Wide_Image if all the
+ graphic characters are defined in Wide_Character; otherwise, the
+ sequence of characters is implementation defined (but no shorter
+ than that of S'Wide_Wide_Image for the same value of Arg).
+
+ S'Image
+ S'Image denotes a function with the following specification:
+ function S'Image(Arg : S'Base) return String
+
+ The function returns an image of the value of Arg as a String.
+ The lower bound of the result is one. The image has the same
+ sequence of graphic characters as that defined for S'Wide_Wide_Image
+ if all the graphic characters are defined in Character; otherwise,
+ the sequence of characters is implementation defined (but no shorter
+ than that of S'Wide_Wide_Image for the same value of Arg).
+
+----
+
+Note that the latter two start with "The function returns an image of the
+value of Arg as ...". In Ada 2012 (and probably before), "image" is a defined
+term, and it is defined as what Wide_Wide_Image returns.
+
+But the wording above (nor anything else) defines such a term. That makes
+those introductory sentences nonsense. It also makes the first use of
+"defined" in the latter two descriptions dubious -- Wide_Wide_Image is a
+function, it doesn't define a "sequence of characters".
+
+My first thought was to get rid of these introductory sentences, since what
+is returned is the result of Put_Image, suitably converted. Since that's
+user-defined, it could be nothing useful at all. This seems functionally
+correct:
+
+ The function returns the result of a call on S'Wide_Wide_Image
+ with a parameter of Arg as a String. The lower bound of the result is
+ one. The result has the same sequence of graphic characters as that
+ returned by S'Wide_Wide_Image if all the graphic characters are
+ defined in Character; otherwise, the sequence of characters is
+ implementation defined (but no shorter than that of S'Wide_Wide_Image
+ for the same value of Arg).
+
+I'm not sure if this is descriptive enough. An alternative would be to rewrite
+the Wide_Wide_Image and define the term "image" there. But even then, I find
+it dubious to talk about the characters "defined" for Wide_Wide_Image, because
+it defines nothing other than to return the result of another call.
+
+I'll use this for now, pending further suggestions.
+
+Aside: The description of Wide_Wide_Image never says what happens to Arg. We
+need to add at a minimum "passing Arg" to "calls Put_Image".
+
+Aside2: The description of Wide_Wide_Image starts "The implementation of
+S'Wide_Wide_Image calls...". What else would we be talking about? That's just
+noise, we can just say "S'Wide_Wide_Image calls...".
****************************************************************
Questions? Ask the ACAA Technical Agent