comp.lang.ada
 help / color / mirror / Atom feed
From: Shark8 <onewingedshark@gmail.com>
Subject: Re: gettext for Ada
Date: Thu, 23 Nov 2017 12:24:33 -0800 (PST)
Date: 2017-11-23T12:24:33-08:00	[thread overview]
Message-ID: <f2159c97-4514-43ce-a5b1-499f9d6b4d10@googlegroups.com> (raw)
In-Reply-To: <ov75jf$d4v$1@dont-email.me>

On Thursday, November 23, 2017 at 11:55:46 AM UTC-7, G. B. wrote:
> Shark8 wrote:
> 
> >> The set of locales may grow. ‘Last etc. would change.
> > 
> > Why would you use 'Last or 'Succ on languages? 
> 
> No type can be exempt from general Ada semantics.
> That’s like asking why I would use 13 for Ada in the USA?

I'm not saying the type should be exempt from the general semantics; I'm saying that the operations don't make sense in the context of language... and that fact could be put into the standard with something like:

"The order and position of the Language and Locale types should not be relied upon, particularly since the referenced standards may be updated and Package Ada.Locales may be updated at any time to reflect the current state of those standards; therefore, usage of 'First, 'Last, 'Succ, 'Pred, 'Val, and 'Pos are discouraged."

Getting the proper value when the OS (or some non-Ada library) returns a string could be done via the 'Value attribute; e.g.:

Function Get_Language return Language is
  Function OS_Get_Language return C_String
   with Import, Convention => C, Link_Name => "getlang";
Begin
  Return Language'Value( To_Ada_String( OS_Get_Language ) );
Exception
   When Constraint_Error => Return und;
End Get Language;

  reply	other threads:[~2017-11-23 20:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-19 20:40 gettext for Ada Victor Porton
2017-11-20 15:40 ` Shark8
2017-11-20 19:28   ` Jacob Sparre Andersen
2017-11-20 19:59     ` Shark8
2017-11-20 20:33       ` Dmitry A. Kazakov
2017-11-21 19:15         ` Jacob Sparre Andersen
2017-11-21 20:54           ` Dmitry A. Kazakov
2017-11-23  9:15             ` Jacob Sparre Andersen
2017-11-23  9:47               ` Dmitry A. Kazakov
2017-11-23 10:03                 ` Jacob Sparre Andersen
2017-11-23 10:37                   ` Dmitry A. Kazakov
2017-11-23 12:14                     ` Jacob Sparre Andersen
2017-11-23 13:23                       ` Dmitry A. Kazakov
2017-11-21 19:22       ` Jacob Sparre Andersen
2017-11-20 22:43   ` Randy Brukardt
2017-11-21  0:28     ` Shark8
2017-11-21  8:29       ` G. B.
2017-11-21 13:48         ` J-P. Rosen
2017-11-22  1:10       ` Randy Brukardt
2017-11-22 15:38         ` Shark8
2017-11-23  0:30           ` Randy Brukardt
2017-11-23  3:08             ` Shark8
2017-11-28  0:48               ` Randy Brukardt
2017-11-28 16:47                 ` Simon Wright
2017-11-28 17:03                 ` Dmitry A. Kazakov
2017-11-28 22:41                   ` Randy Brukardt
2017-11-29  9:09                     ` Dmitry A. Kazakov
2017-11-23  8:25           ` G. B.
2017-11-23 16:02             ` Shark8
2017-11-23 18:55               ` G. B.
2017-11-23 20:24                 ` Shark8 [this message]
2017-11-28  0:55                   ` Randy Brukardt
2017-11-22 21:36 ` Blady
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox