From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,2e6723b897ab47fb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 Received: by 10.68.141.225 with SMTP id rr1mr38485pbb.2.1344480259499; Wed, 08 Aug 2012 19:44:19 -0700 (PDT) Path: g9ni18119766pbo.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin3!goblin.stu.neva.ru!news.szaf.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Mon, 06 Aug 2012 20:34:22 +0100 Organization: A noiseless patient Spider Message-ID: References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="edf2659fbb8cb6d4b5f62db4b36ac1e6"; logging-data="30087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/jTl47xJR+ZR47xTMnSjhPDOrziz0BYkk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (darwin) Cancel-Lock: sha1:GshubgZ1p3UtU6L87E/+jlhE1UA= sha1:ms4abG2q4vZiWiugtPsh0W/Recg= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2012-08-06T20:34:22+01:00 List-Id: "J-P. Rosen" writes: > Le 06/08/2012 19:10, Marius Amado-Alves a écrit : >> To clarify: Put_Line does NOT work. The compiler (GNAT GPL 2012) says: >> >> Put_Line (Country) => >> expected type "Standard.String" >> found type "Ada.Locales.Country_Code" >> >> Put_Line (String (Country)) => >> component subtypes must statically match >> > But they can be converted to String: > Put_Line (String (Country)); Not with GNAT GPL 2012 or GCC 4.7.0: GNAT GPL 2012 (20120509) Copyright 1992-2012, Free Software Foundation, Inc. Compiling: locales.adb (source file time stamp: 2012-08-06 19:30:36) 1. with Ada.Locales; | >>> warning: "Ada.Locales" is an internal GNAT unit >>> warning: use of this unit is non-portable and version-dependent 2. with Ada.Text_IO; use Ada.Text_IO; 3. procedure Locales is 4. begin 5. Put_Line (String (Ada.Locales.Language_Code)); | >>> component subtypes must statically match 6. Put_Line (String (Ada.Locales.Country_Code)); | >>> component subtypes must statically match 7. end Locales; But note the warning!