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,ASCII-7-bit Received: by 10.236.170.1 with SMTP id o1mr11191993yhl.42.1344998912275; Tue, 14 Aug 2012 19:48:32 -0700 (PDT) MIME-Version: 1.0 Path: c6ni115625004qas.0!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.x-privat.org!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Thu, 9 Aug 2012 15:47:25 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> <7303f906-0f6a-4d97-ae15-36b4056ede6c@googlegroups.com> <87mx274066.fsf@adaheads.sparre-andersen.dk> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1344545248 17555 69.95.181.76 (9 Aug 2012 20:47:28 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 9 Aug 2012 20:47:28 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Date: 2012-08-09T15:47:25-05:00 List-Id: "Jacob Sparre Andersen" wrote in message news:87mx274066.fsf@adaheads.sparre-andersen.dk... > Adam Beneschan wrote: > >> They already are a subtype of Character, i.e. the subtype "Character >> range 'a' .. 'z'". The only way to make it convertible is to get rid >> of the range. > > What about using an aspect to instead of a subtype? Wouldn't that allow > the conversion, while still keeping the constraints? No. > subtype Language_Code is String (1 .. 3) > with Static_Predicate => Language_Code (1) in 'a' .. 'z' and > Language_Code (2) in 'a' .. 'z' and > Language_Code (3) in 'a' .. 'z'; The rule requires static matching, and that requires the same static predicates. The requirement on the type conversions seems rather unfriendly, certainly for String; but I can't predict what the ARG will do with this one. Randy.