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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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,ASCII-7-bit Received: by 10.66.74.225 with SMTP id x1mr1428862pav.45.1344849117543; Mon, 13 Aug 2012 02:11:57 -0700 (PDT) Path: p10ni52838691pbh.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!novia!feeder3.cambriumusenet.nl!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.130.MISMATCH!xlned.com!feeder1.xlned.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!news-feed.eu.lambdanet.net!texta.sil.at!news.glorb.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Marius Amado-Alves Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Tue, 7 Aug 2012 06:14:13 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> <7303f906-0f6a-4d97-ae15-36b4056ede6c@googlegroups.com> <257b4f44-b6c6-4c79-8c6e-dec947a3ce25@googlegroups.com> NNTP-Posting-Host: 188.82.45.163 Mime-Version: 1.0 X-Trace: posting.google.com 1344345253 3920 127.0.0.1 (7 Aug 2012 13:14:13 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 7 Aug 2012 13:14:13 +0000 (UTC) In-Reply-To: <257b4f44-b6c6-4c79-8c6e-dec947a3ce25@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=188.82.45.163; posting-account=3cDqWgoAAAAZXc8D3pDqwa77IryJ2nnY User-Agent: G2/1.0 X-Received-Bytes: 2489 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-08-07T06:14:13-07:00 List-Id: I took the chance to learn subtype aspect clauses, and changed Ada_Locales thus: subtype Country_Code is String (1 .. 2) with Static_Predicate => Country_Code (1) in 'A' .. 'Z' and Country_Code (2) in 'A' .. 'Z'; (Now Text_IO.Put works of course, but I think it should work in the first place.) This little experiment exposed other strange things: (1) It seems the compiler accepts the type name, in the aspect clause, as a representative of a value of the type. I could not find this documented in the RM. (2) The aspect clause does not seem to have effect. The following code compiles and runs normally. CC : Ada_Locales.Country_Code := "34"; Of course (2) can be an effect of the semantic void of (1).