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.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA 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.40 with SMTP id q8mr1796772pav.19.1344847627730; Mon, 13 Aug 2012 01:47:07 -0700 (PDT) Path: g9ni51107834pbo.0!nntp.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!news-in-01.newsfeed.easynews.com!easynews.com!easynews!novia!news-peer1!btnet!zen.net.uk!hamilton.zen.co.uk!xlned.com!feeder3.xlned.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!80.86.168.138.MISMATCH!news-feed.eu.lambdanet.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Wed, 08 Aug 2012 14:52:01 +0300 Organization: Tidorum Ltd 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> Mime-Version: 1.0 X-Trace: individual.net iK2yn3UeC7UFmLKpQRm6QA7WMMErYSxu9zYTmgbn2idstyxJBN/R2keUcfC2VUctM9 Cancel-Lock: sha1:NZDd+3iuiGh8Pt0ggqRLnigMjrs= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: <19aidilocj3ue$.ljphjv09js71.dlg@40tude.net> X-Received-Bytes: 3308 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Date: 2012-08-08T14:52:01+03:00 List-Id: 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. > 2. It is extremely uncomfortable to have legality dependant on the > constraint and the parameter mode. It is worse than just inference it is in > effect weakly typing. We won't agree on that one. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .