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.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_24_48 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.82.2 with SMTP id e2mr528697pay.40.1344480220861; Wed, 08 Aug 2012 19:43:40 -0700 (PDT) Path: p10ni18107792pbh.1!nntp.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nrc-news.nrc.ca!goblin2!goblin.stu.neva.ru!feeder.erje.net!newsfeed.straub-nv.de!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Tue, 07 Aug 2012 09:43:29 +0200 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: <87mx274066.fsf@adaheads.sparre-andersen.dk> References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> <7303f906-0f6a-4d97-ae15-36b4056ede6c@googlegroups.com> NNTP-Posting-Host: monowall.adaheads.com Mime-Version: 1.0 X-Trace: munin.nbi.dk 1344325410 27103 77.234.168.91 (7 Aug 2012 07:43:30 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Tue, 7 Aug 2012 07:43:30 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:OOU3tbOnKyHfxpwnjLMGNXdAlRg= Content-Type: text/plain; charset=us-ascii Date: 2012-08-07T09:43:29+02:00 List-Id: 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? 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'; Greetings, Jacob -- "If we weren't at least occasionally surprised by the results, we might as well save ourselves the trouble of measuring :)"