CVS difference for ai05s/ai05-0127-2.txt
--- ai05s/ai05-0127-2.txt 2010/08/06 02:53:54 1.3
+++ ai05s/ai05-0127-2.txt 2010/08/07 05:44:42 1.4
@@ -1,4 +1,4 @@
-!standard A.19(0) 10-08-05 AI05-0127-2/03
+!standard A.19(0) 10-08-06 AI05-0127-2/04
!standard 1.2(1)
!standard 1.2(4/2)
!class Amendment 10-06-01
@@ -61,6 +61,9 @@
A.19 The Package Locales
+A locale identifies a geopolitical place or region and its associated
+language, which can be used to determine other internationalization
+related characteristics.
Static Semantics
@@ -68,6 +71,7 @@
package Ada.Locales is
pragma Preelaborate(Locales);
+ pragma Remote_Types(Locales);
type Language_Code is array (1 .. 3) of Character range 'a' .. 'z';
type Country_Code is array (1 .. 2) of Character range 'A' .. 'Z';
@@ -80,27 +84,22 @@
end Ada.Locales;
-A locale identifies a geopolitical place or region, its associated
-character sets, data and time formats, currency formats, and other
-internationalization related characteristics. The active locale is
-the locale associated with the active partition.
+The active locale is the locale associated with the active partition.
Language_Code is a lower-case string representation of an ISO 639-3
-alpha-3 code that identifies the language associated with the
-active locale.
+alpha-3 code that identifies a language.
Country_Code is an upper-case string representation of an ISO 3166-1
-alpha-2 code that identifies the country associated with the
-active locale.
+alpha-2 code that identifies a country.
-Dynamic Semantics
+Function Language returns the code of the language associated with the
+active locale. If the Language_Code associated with the active locale cannot
+be determined from the environment then Language returns Language_Unknown.
-If the Country_Code associated with the active locale cannot be
+Function Country returns the code of the country associated with the
+active locale. If the Country_Code associated with the active locale cannot be
determined from the environment then Country returns Country_Unknown.
-If the Language_Code associated with the active locale cannot
-be determined from the environment then Language returns Language_Unknown.
-
!discussion
ISO 3166-1 defines three sets of codes; alpha-2, alpha-3, and numeric-3.
@@ -325,12 +324,17 @@
@dinsc
+A @b<locale> identifies a geopolitical place or region and its associated
+language, which can be used to determine other internationalization
+related characteristics.
+
@s8<@i<Static Semantics>>
The following language-defined library package exists:
@xcode<@b<package> Ada.Locales @b<is>
@b<pragma> Preelaborate(Locales);
+ @b<pragma> Remote_Types(Locales);
@b<type> Language_Code @b<is array> (1 .. 3) @b<of> Character @b<range> 'a' .. 'z';
@b<type> Country_Code @b<is array> (1 .. 2) @b<of> Character @b<range> 'A' .. 'Z';
@@ -343,27 +347,23 @@
@b<end> Ada.Locales;>
-A @i<locale> identifies a geopolitical place or region, its associated
-character sets, data and time formats, currency formats, and other
-internationalization related characteristics. The active locale is
+The @i<active locale> is
the locale associated with the active partition.
Language_Code is a lower-case string representation of an ISO 639-3
-alpha-3 code that identifies the language associated with the
-active locale.
+alpha-3 code that identifies a language.
Country_Code is an upper-case string representation of an ISO 3166-1
-alpha-2 code that identifies the country associated with the
-active locale.
+alpha-2 code that identifies a country.
-@s8<@i<Dynamic Semantics>>
+Function Language returns the code of the language associated with the
+active locale. If the Language_Code associated with the active locale cannot
+be determined from the environment then Language returns Language_Unknown.
-If the Country_Code associated with the active locale cannot be
+Function Country returns the code of the country associated with the
+active locale. If the Country_Code associated with the active locale cannot be
determined from the environment then Country returns Country_Unknown.
-If the Language_Code associated with the active locale cannot
-be determined from the environment then Language returns Language_Unknown.
-
!ACATS test
@@ -1724,6 +1724,120 @@
However, if the current locale is more specificly defined to be Mandarin
Chinese, 639-3 provides a code "cmn" for this purpose. 639-2 does not break down
chinese any further than the macro language
+
+****************************************************************
+
+From: Randy Brukardt
+Date: Thursday, August 5, 2010 9:57 PM
+
+The wording in for this package has no introduction. Compare to A.16
+(Directories) or A.17 (Environment_Variables).
+
+The first sentence of the wording could be moved to be an introduction:
+
+A locale identifies a geopolitical place or region, its associated character
+sets, data and time formats, currency formats, and other internationalization
+related characteristics.
+
+"locale" probably ought to be in italics here.
+
+But this wording bothers me, as it seems to promise at lot more than this
+package actually is going to deliver (country and language codes). There is
+nothing about character sets, time formats, or currency formats here! I'd be
+happier if we promised less:
+
+A locale identifies a geopolitical place or region and its associated language,
+which can be used to determine other internationalization related
+characteristics.
+
+Anybody have better wording or another idea??
+
+---
+
+Another problem with this wording: there never is anything that says what
+Language and Country return (other than in the case where they don't know). We
+define what a Language_Code and a Country_Code is, but that wording seems to
+assume the only way to get such a value is from these functions (which is
+obviously False, given the constants and string literals in the package). Surely
+the *type* has nothing to do with the active locale!
+
+So, for example, the Country_Code should be defined as follows:
+
+Country_Code is an upper-case string representation of an ISO 3166-1 alpha-2
+code that identifies a country.
+
+And the function Country as (with the second sentence being the existing
+wording):
+
+Function Country returns the code of the country associated with the active
+locale. If the Country_Code associated with the active locale cannot be
+determined from the environment then Country returns Country_Unknown.
+
+Language and Language_Code should be defined in the same way.
+
+---
+
+Finally a trivial glitch: the runtime semantics of library packages are always
+defined in the Static Semantics section (don't ask me why); there shouldn't be a
+Dynamic Semantics section.
+
+****************************************************************
+
+From: Brad Moore
+Date: Friday, August 6, 2010 3:02 PM
+
+> The first sentence of the wording could be moved to be an introduction:
+>
+
+Agree
+
+> A locale identifies a geopolitical place or region and its associated
+> language, which can be used to determine other internationalization
+> related characteristics.
+>
+> Anybody have better wording or another idea??
+>
+
+I am fine with the wording you have suggested, unless someone comes up with
+something better.
+
+> So, for example, the Country_Code should be defined as follows:
+>
+> Country_Code is an upper-case string representation of an ISO 3166-1
+> alpha-2 code that identifies a country.
+>
+> And the function Country as (with the second sentence being the
+> existing
+> wording):
+>
+> Function Country returns the code of the country associated with the
+> active locale. If the Country_Code associated with the active locale
+> cannot be determined from the environment then Country returns Country_Unknown.
+>
+> Language and Language_Code should be defined in the same way.
+
+Agree
+
+One other thing I have been thinking about. I think it would be nice if this
+package could be a remote types package.
+
+For example, I can imagine a server application that receives client requests
+from clients using different locales. The client could include its
+country/language code in the request, and the server could respond with a
+response suitable for the clients locale.
+
+****************************************************************
+
+From: Randy Brukardt
+Date: Saturday, August 7, 2010 12:17 AM
+
+...
+> One other thing I have been thinking about. I think it would be nice
+> if this package could be a remote types package.
+
+That seems harmless, given that the package only exports two visible string
+types. How could it *not* work as a remote types package?? It surely meets all
+of the requirements of E.2.2. I'll add the missing pragma to the specification.
****************************************************************
Questions? Ask the ACAA Technical Agent