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: 103376,2e6723b897ab47fb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Received: by 10.180.100.98 with SMTP id ex2mr23146wib.4.1344411130908; Wed, 08 Aug 2012 00:32:10 -0700 (PDT) Path: n2ni22972691win.0!nntp.google.com!goblin3!goblin.stu.neva.ru!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Ada.Locales pseudo-string types Date: Wed, 08 Aug 2012 09:32:09 +0200 Organization: A noiseless patient Spider Message-ID: References: <78707b6e-88a3-453a-a37c-840f7a62e703@googlegroups.com> <7303f906-0f6a-4d97-ae15-36b4056ede6c@googlegroups.com> <257b4f44-b6c6-4c79-8c6e-dec947a3ce25@googlegroups.com> Mime-Version: 1.0 Injection-Date: Wed, 8 Aug 2012 07:32:08 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="cde0054f05a4d4958ef5363f6c36ea72"; logging-data="13114"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/YdIhi6HIk6BX6N6qDQHPq" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 In-Reply-To: Cancel-Lock: sha1:V+6KAFRhJw3TEWqjjG6MZgk3lWM= X-Enigmail-Version: 1.4.3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Date: 2012-08-08T09:32:09+02:00 List-Id: Le 08/08/2012 09:04, Niklas Holsti a �crit : > The rule does seem surprisingly rigid, for a value conversion. (The > Annotated RM does not explain or motivate it.) For a value conversion, > the default could be to convert element by element, and the compiler > could then optimize this conversion based on what it can deduce > statically about the matching of the source and target subtypes. One of the founding principles of Ada was "no hidden inefficiencies" (whether this has been achieved is another story). Since an array can have many elements, this could be quite costly. And of course, it would force pass-by-copy > In the example, the compiler should be able to deduce that > element-by-element conversion is unnecessary since the source element > subtype is a subrange of the target element subtype. But if the conversion is used for an in-out parameter, it implies the opposite conversion - where nothing can be deduced. And you don't want a special rule that works only for in parameters, and only with compilers that pass arrays by copy, would you? -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr