CVS difference for ai12s/ai12-0021-1.txt

Differences between 1.2 and version 1.3
Log of other versions for file ai12s/ai12-0021-1.txt

--- ai12s/ai12-0021-1.txt	2013/05/09 23:26:40	1.2
+++ ai12s/ai12-0021-1.txt	2018/12/06 00:14:55	1.3
@@ -1,4 +1,16 @@
-!standard A.16(0/3)                                 12-03-13    AI12-0021-1/01
+!standard 11.4.1(19)                                 18-10-29    AI12-0021-1/02
+!standard A.8.1(15)
+!standard A.8.2(1)
+!standard A.8.2(29)
+!standard A.8.4(18)
+!standard A.8.4(20)
+!standard A.10.1(85)
+!standard A.10.2(5)
+!standard A.12.1(26)
+!standard A.12.1(33)
+!standard A.15.1(0)
+!standard A.16.2(0)
+!standard A.17.1(0)
 !class Amendment 12-03-13
 !status work item 12-02-25
 !status received 12-02-25
@@ -7,7 +19,9 @@
 !subject Additional internationalization of Ada
 !summary
 
-**TBD.
+Support is added for the use of the entire set of characters from ISO/IEC
+10646:2017 for file and directory names by the operations of the Annex A
+facilities.
 
 !proposal
 
@@ -24,8 +38,298 @@
 
 !wording
 
-** TBD.
+Add after 11.4.1(19):
 
+It is recommended that UTF-8 encoding be used for encoding exception messages
+that require non-ASCII characters.
+
+Add after A.8.1(15):
+
+... -- Enclosing package Ada.Sequential_IO
+
+package Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_String := "";
+                    Form : in Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_String;
+                    Form : in Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_String;
+
+   function Form   (File : in File_Type) return Wide_String;
+
+end Wide_File_Names;
+
+package Wide_Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_Wide_String := "";
+                    Form : in Wide_Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_Wide_String;
+                    Form : in Wide_Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_Wide_String;
+
+   function Form   (File : in File_Type) return Wide_Wide_String;
+
+end Wide_Wide_File_Names;
+
+
+Modify A.8.2(1):
+
+The procedures and functions described in this subclause provide for the control
+of external files; their declarations are repeated in each of the packages for
+sequential, direct, text, {wide text, wide wide text, }and stream input-output.
+For text input-output, the procedures Create, Open, and Reset have additional
+effects described in subclause A.10.2.
+
+
+Add at the end of A.8.2:
+
+The nested package Wide_File_Names provides operations that are the equivalent
+of those for regular Sequential_IO except that Wide_String is used instead of
+String for the name and form of the external file.
+
+The nested package Wide_Wide_File_Names provides operations that are the
+equivalent of those for regular Sequential_IO except that Wide_Wide_String is
+used instead of String for the name and form of the external file.
+
+
+Add after A.8.4(18):
+
+... -- Enclosing package Ada.Direct_IO
+
+package Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := InOut_File;
+                    Name : in Wide_String := "";
+                    Form : in Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_String;
+                    Form : in Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_String;
+
+   function Form   (File : in File_Type) return Wide_String;
+
+end Wide_File_Names;
+
+package Wide_Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := InOut_File;
+                    Name : in Wide_Wide_String := "";
+                    Form : in Wide_Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_Wide_String;
+                    Form : in Wide_Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_Wide_String;
+
+   function Form   (File : in File_Type) return Wide_Wide_String;
+
+end Wide_Wide_File_Names;
+
+
+Add at the end of A.8.4:
+
+The nested package Wide_File_Names provides operations that are the equivalent
+of those for regular Direct_IO except that Wide_String is used instead of String
+for the name and form of the external file.
+
+The nested package Wide_Wide_File_Names provides operations that are the
+equivalent of those for regular Direct_IO except that Wide_Wide_String is used
+instead of String for the name and form of the external file.
+
+
+Add after A.10.1(85):
+
+... -- Enclosing package Ada.Text_IO
+
+package Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_String := "";
+                    Form : in Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_String;
+                    Form : in Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_String;
+
+   function Form   (File : in File_Type) return Wide_String;
+
+end Wide_File_Names;
+
+package Wide_Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_Wide_String := "";
+                    Form : in Wide_Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_Wide_String;
+                    Form : in Wide_Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_Wide_String;
+
+   function Form   (File : in File_Type) return Wide_Wide_String;
+
+end Wide_Wide_File_Names;
+
+
+Add at the end of A.10.2:
+
+The nested package Wide_File_Names provides operations that are the equivalent
+of those for regular Text_IO except that Wide_String is used instead of String
+for the name and form of the external file.
+
+The nested package Wide_Wide_File_Names provides operations that are the
+equivalent of those for regular Text_IO except that Wide_Wide_String is used
+instead of String for the name and form of the external file.
+
+
+Add after A.12.1(26):
+
+... -- Enclosing package Ada.Stream_IO
+
+package Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_String := "";
+                    Form : in Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_String;
+                    Form : in Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_String;
+
+   function Form   (File : in File_Type) return Wide_String;
+
+end Wide_File_Names;
+
+package Wide_Wide_File_Names is
+
+   -- File management
+
+   procedure Create(File : in out File_Type;
+                    Mode : in File_Mode := Out_File;
+                    Name : in Wide_Wide_String := "";
+                    Form : in Wide_Wide_String := "");
+
+   procedure Open  (File : in out File_Type;
+                    Mode : in File_Mode;
+                    Name : in Wide_Wide_String;
+                    Form : in Wide_Wide_String := "");
+
+   function Name   (File : in File_Type) return Wide_Wide_String;
+
+   function Form   (File : in File_Type) return Wide_Wide_String;
+
+end Wide_Wide_File_Names;
+
+
+Add after A.12.1(33):
+
+The nested package Wide_File_Names provides operations that are the equivalent
+of those for regular Stream_IO except that Wide_String is used instead of String
+for the name and form of the external file.
+
+The nested package Wide_Wide_File_Names provides operations that are the
+equivalent of those for regular Stream_IO except that Wide_Wide_String is used
+instead of String for the name and form of the external file.
+
+
+Add section A.15.1:
+
+A.15.1 The Packages Wide_Command_Line and Wide_Wide_Command_Line
+
+The packages Wide_Command_Line and Wide_Wide_Command_Line allow a program to
+obtain the values of its arguments and to set the exit status code to be
+returned on normal termination.
+
+Static Semantics
+
+The specification of package Wide_Command_Line is the same as for Command_Line,
+except that each occurrence of String is replaced by Wide_String.
+
+The specification of package Wide_Wide_Command_Line is the same as for
+Command_Line, except that each occurrence of String is replaced by
+Wide_Wide_String.
+
+
+Add section A.16.2:
+
+A.16.2 The Packages Wide_Directories and Wide_Wide_Directories
+
+The packages Wide_Directories and Wide_Wide_Directories provide operations for
+manipulating files and directories, and their names.
+
+Static Semantics
+
+The specification of package Wide_Directories is the same as for Directories
+(including its optional child package Hierarchical_File_Names), except that each
+occurrence of String is replaced by Wide_String.
+
+The specification of package Wide_Wide_Directories is the same as for
+Directories (including its optional child package Hierarchical_File_Names),
+except that each occurrence of String is replaced by Wide_Wide_String.
+
+
+Add section A.17.1:
+
+A.17.1 The Packages Wide_Environment_Variables and Wide_Wide_Environment_Variables
+
+The packages Wide_Environment_Variables and Wide_Wide_Environment_Variables
+allow a program to read or modify environment variables.
+
+Static Semantics
+
+The specification of package Wide_Environment_Variables is the same as for
+Environment_Variables, except that each occurrence of String is replaced by
+Wide_String.
+
+The specification of package Wide_Wide_Environment_Variables is the same as for
+Environment_Variables, except that each occurrence of String is replaced by
+Wide_Wide_String.
+
+
 !discussion
 
 These issues defy an easy solution. Changing the behavior of the existing
@@ -33,8 +337,7 @@
 Linux systems, have no problems with directly using UTF-8 strings) and other
 commonly used functionality (like encoding binary data in exception messages).
 
-Adding even more Wide_Wide_ packages and routines is madness, and may not even
-make sense on many targets.
+Adding even more Wide_Wide_ packages and routines is a combinational explosion.
 
 The crux of this problem is that the semantics and representation of strings
 have become co-mingled. What we really need to do is to separate these; the
@@ -111,12 +414,21 @@
 along when passed into routines (which have to be new for this reason). Once
 that is available, then any problems can be dealt with by simply using whatever
 representation is appropriate for the target system.
+
+====
+
+The above was discussed at the Lisbon 2018 meeting and considered too ambitious
+for the Ada 2020 timescales.
 
-This clearly will need a lot of work...
+It was considered useful though to add child packages Wide_File_Names and
+Wide_Wide_File_Names for each I/O package, containing just those operations that
+take a filename as a parameter, and Wide_ and Wide_Wide_ versions of
+Ada.Directories, Ada.Command_Line and Ada.Environment_Variables. Also, UTF-8
+encoding should be recommended for exception messages.
 
 !ACATS test
 
-** TBD.
+ACATS C-Tests are needed for the new packages (nested and otherwise).
 
 !appendix
 

Questions? Ask the ACAA Technical Agent