Version 1.1 of ais/ai-00281.txt

Unformatted version of ais/ai-00281.txt version 1.1
Other versions for file ais/ai-00281.txt

!standard 13.04 (04)          01-12-26 AI95-00281/01
!class amendment 01-12-26
!status work item 01-12-26
!status received 01-12-11
!priority Low
!difficulty Medium
!subject Representation of enumeration type image attribute
The image of an enumeration is not very flexible. It is not possible to have an image that is not a proper identifier, nor is the case of the image specifiable.
Provide a mechanism for specifying the image of enumeration types.
The Image attribute is specifiable. The specified item is an one-dimensional array aggregate, with the index subtype is the enumeration type, and each component expression is of type String. Each component expression must be static.
(Specific wording changes TBD.)
If this proposal is adopted, the meaning of Ada.Text_IO.Get and Put for enumeration types should be changed to output the specified Image for types with a specified Image. (Otherwise, implementations would have to add another pair of attributes like 'Identifier_Image and 'Identifier_Value in order to implement this routine, as the regular 'Image and 'Value could no longer be used.
Claw uses 'Image to provide automatically labels to sets of radio buttons. In order to make pleasing labels, Claw has to convert the labels to Mixed case form, and replace '_' by spaces. Existing code like this (that assumes that the format of 'Image is that of an identifier) would break if given a type with a specified 'Image.
[Can you tell I don't like this proposal? - ED]
type Currency is (Dollar, Pound, Euro) ; for Currency'Image use (Dollar => "$", Pound => "", Euro => "") ;
!ACATS test

!topic Representation of enumeration type image attribute
!reference RM95-13.3
!from Bernard Maudry

Because of the limitations in the strings used as enumeration image, it
would be very helpful to be able to specify the image attribute for
enumeration types. The behavior of the value attribute will be changed

For example:
type Currency is (Dollar, Pound, Euro) ;
for Currency'image use (Dollar => "$", Pound => "", Euro => "") ;
(Sorry if the font you use does not provide the necessary characters).


Questions? Ask the ACAA Technical Agent