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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,2e6723b897ab47fb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.180.24.135 with SMTP id u7mr194584wif.3.1344432047112; Wed, 08 Aug 2012 06:20:47 -0700 (PDT) Path: n2ni26949118win.0!nntp.google.com!volia.net!news2.volia.net!feed-A.news.volia.net!news.musoftware.de!wum.musoftware.de!news.mixmin.net!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Wed, 8 Aug 2012 15:21:00 +0200 Organization: cbb software GmbH Message-ID: References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> <7303f906-0f6a-4d97-ae15-36b4056ede6c@googlegroups.com> <257b4f44-b6c6-4c79-8c6e-dec947a3ce25@googlegroups.com> <19aidilocj3ue$.ljphjv09js71.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: FbOMkhMtVLVmu7IwBnt1tw.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Date: 2012-08-08T15:21:00+02:00 List-Id: On Wed, 08 Aug 2012 14:52:01 +0300, Niklas Holsti wrote: > On 12-08-08 11:35 , Dmitry A. Kazakov wrote: >> On Wed, 08 Aug 2012 11:17:46 +0300, Niklas Holsti wrote: >> >>> For value conversions, including "in" parameters, the exact match could >>> be replaced by a static check that the constraints on the source >>> elements are the same as or stronger than those on the target elements. >>> This would allow Ada.Text_IO.Put (String (Some_Country_Code)). >>> >>> For "out" parameters, there could be a static check that the constraints >>> on the actual (source) array elements are the same as or weaker than >>> those on the formal (target) array elements. >>> >>> For "in out" parameters, the present static-match rule would be kept, as >>> the logical conjunction of the "in" and "out" rules. >> >> 1. You cannot check that statically because the constraint of the subtype >> can be dynamic. > > I meant (of course!) that the conversion would be allowed only if the > strengths of the constraints can be checked statically, using similar > kinds of rules as are now used for "statically matching" subtypes and > constraints. In effect, the bounds of the ranges would have to match > exactly, or be static expressions with values in the necessary order > relationships. Well, that could work. However error messages would be quite annoying when something turns to be not so static as it appears. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de