CVS difference for ais/ai-00285.txt

Differences between 1.3 and version 1.4
Log of other versions for file ais/ai-00285.txt

--- ais/ai-00285.txt	2002/05/25 03:42:19	1.3
+++ ais/ai-00285.txt	2002/10/01 03:08:54	1.4
@@ -1,19 +1,178 @@
-!standard A.3.2(49)                                    02-01-23  AI95-00285/00
+!standard A.3.2(49)                                    02-09-24  AI95-00285/01
 !class amendment 02-01-23
+!status work item 02-09-24
 !status received 02-01-15
 !priority Medium
 !difficulty Hard
-!subject Latin-9 and Ada.Characters.Handling
+!subject Latin-9, Ada.Characters.Handling, and 32-bit characters
 
 !summary
 
 !problem
 
-Latin-9 has been introduced.
+Latin-9 has been introduced by ISO/IEC 8859-15:1999.  Moreover, the working
+draft of ISO/IEC 10646:2003 makes use of planes other than the BMP.
 
 !proposal
 
+In order to support Latin-9, we allow an implementation to provide a
+package named Ada.Characters.Latin_9, but we strictly restrict its contents
+to correspond to the characters defined by ISO/IEC 8859-15:1999.
+
+If an application chooses to use both Latin-1 and Latin-9, the package
+Ada.Characters.Handling is quite problematic, as it seems to assume that
+Character always corresponds to Latin-1, and it would get the
+classifications and the conversions wrong for some Latin-9 characters.  We
+deal with this by recognizing that this package is really specific to the
+character encoding being used, and making it a child of the proper Latin_n
+package.  A library-level renaming is provided for compatibility with
+existing applications.
+
+The constant Character_Set in Ada.Strings.Wide_Maps.Wide_Constants is
+similarly problematic as it is defined by reference to
+Ada.Characters.Handling.  We define both the Latin-1 and the Latin-9 sets
+in Wide_Constants, and provide a renaming for compatibility.  <<We should
+probably give permission to add more constants if an implementation wants
+to support other character encodings.>>
+
+ISO/IEC 8859-15 defines  as a letter and  as a ligature.  There seems to
+be no reason to make a distinction between the two, so for the purposes of
+Ada.Characters.Latin_9.Handling, we classify both as letters.
+
+Note that we are not proposing to change the lexical rules of the language,
+so it's still the case that only characters from row 00 of the BMP are
+allowed in identifiers (row 00 of the BMP is not affected by Latin-9).
+
+
+In order to support 32-bit characters, we allow an implementation to add
+new declarations to Standard.  If it does, it must provide the appropriate
+predefined units for 32-bit characters, and new attributes to convert
+discrete values to and from 32-bit strings.
+
+Again, we are not proposing to change the lexical rules of the language, so
+the character and string literals appearing in the program can only make
+use of the graphic symbols from the BMP.  The characters from other planes
+cannot be represented in literals; they must be obtained by evaluating more
+complex expressions; for instance, by evaluating Wide_Wide_Character'Val
+(16#1001B#) it is possible to access the Linear B syllable NI.
+
+!wording
+
+An implementation is allowed to provide a library package named
+Ada.Characters.Latin_9.  This package shall be identical to
+Ada.Characters.Latin_1, except for the following differences:
+
+- It doesn't declare the constants Currency_Sign, Broken_Bar, Diaeresis,
+Acute, Cedilla, Fraction_One_Quarter, Fraction_One_Half, and
+Fraction_Three_Quarter.
+
+- It declares the following constants:
+
+    Euro_Sign : constant Character := ''; -- Character'Val (164)
+    UC_S_Caron : constant Character := ''; -- Character'Val (166)
+    LC_S_Caron : constant Character := ''; -- Character'Val (168)
+    UC_Z_Caron : constant Character := ''; -- Character'Val (180)
+    LC_Z_Caron : constant Character := ''; -- Character'Val (184)
+    UC_OE_Diphthong : constant Character := ''; -- Character'Val (188)
+    LC_OE_Diphthong : constant Character := ''; -- Character'Val (189)
+    UC_Y_Diaeresis : constant Character := ''; -- Character'Val (190)
+
+In addition, an implementation which provides Ada.Characters.Latin_9 must
+provide two library packages named Ada.Characters.Latin_1.Handling and
+Ada.Characters.Latin_9.Handling, respectively.
+Ada.Characters.Latin_1.Handling must have the same contents and semantics
+as the package Ada.Characters.Handling defined in section A.3.2 of ISO/IEC
+8652:1995 with COR.1:2000 (except of course for the library unit name).
+For compatibility with existing applications, the following library-level
+renaming must also be provided:
+
+    package Ada.Characters.Handling renames
+       Ada.Characters.Latin_1.Handling;
+
+The package Ada.Characters.Latin_9.Handling has the same specification as
+Ada.Characters.Latin_1.Handling, but the following semantic differences:
+
+- The function Is_Letter returns True for the characters at positions 166,
+168, 180, 184, 188, 189 and 190 (in addition to those for which it is defined
+to return True in A.3.2(24)).
+
+- The function Is_Lower returns True for the characters at positions 168,
+184 and 189 (in addition to those for which it is defined to return True in
+A.3.2(25)).
+
+- The function Is_Upper returns True for the characters at positions 166,
+180, 188 and 190 (in addition to those for which it is defined to return
+True in A.3.2(26)).
+
+- The function Is_Basic return True for the characters at positions 188 and
+189 (in addition to those for which it is defined to return True in A.3.2
+(27)).
+
+- The upper-case form of '' is '' for the purposes of function To_Upper.
+
+- The function Is_Character return true if the Wide_Character Item has a
+name in ISO/IEC 10646 which is the name of some Character in
+ISO/IEC 8859-15.
+
+- The function To_Character returns the Character which has the same name
+in ISO/IEC 8859-15 as the Wide_Character Item in ISO/IEC 10646.
+
+- The function To_Wide_Character returns the Wide_Character which has the
+same name in ISO/IEC 10646 as the Character Item in ISO/IEC 8859-15.
+
+The declaration of Character_Set in Ada.Strings.Wide_Maps.Wide_Constants is
+removed.  It is replaced by:
+
+    Latin_1_Character_Set : constant Wide_Maps.Wide_Character_Set;
+    Latin_9_Character_Set : constant Wide_Maps.Wide_Character_Set;
+    Character_Set : Wide_Maps.Wide_Character_Set renames
+                    Latin_1_Character_Set;
+
+
+An implementation is allowed to add the following declarations to package
+Standard:
+
+    type Wide_Wide_Character is (nul, soh, ..., FFFE, FFFF,
+                                 00010000, ..., 7FFFFFFF);
+    type Wide_Wide_String is array (Positive range <>) of
+                                    Wide_Wide_Character;
+    pragma Pack (Wide_Wide_String);
+
+The type Wide_Wide_Character has 2 ** 31 values.  Its first 2 ** 16
+positions must have the same contents as type Wide_Character.
+
+If an implementation provides these two types, it must also provide the
+following packages:
+
+    Ada.Strings.Wide_Wide_Bounded
+    Ada.Strings.Wide_Wide_Fixed
+    Ada.Strings.Wide_Wide_Maps
+    Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants
+    Ada.Strings.Wide_Wide_Unbounded
+    Ada.Wide_Wide_Text_IO
+
+These packages are similar to their Wide_ equivalents, with Wide_Wide_
+substituted for Wide_ everywhere.  In addition the following declaration is
+present in Ada.Strings.Wide_Wide_Maps.Wide_Wide_Constants:
+
+    Wide_Character_Set : constant Wide_Wide_Maps.Wide_Wide_Character_Set;
+
+It contains each Wide_Wide_Character value in the BMP of ISO/IEC 10646.
+
+The attributes Wide_Wide_Image, Wide_Wide_Value and Wide_Wide_Width must
+also be provided.  Their definition is similar to that of Wide_Image,
+Wide_Value and Wide_Width, respectively, with Wide_Character and
+Wide_String replaced by Wide_Wide_Character and Wide_Wide_String.
+
+The semantics of Wide_Image are modified as follows: 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 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).
+
 !discussion
+
+See proposal.
 
 !example
 

Questions? Ask the ACAA Technical Agent