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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "G.B." Newsgroups: comp.lang.ada Subject: Re: Surprising behaviour of strings.fixed.overwrite Date: Wed, 12 Nov 2014 13:55:41 +0100 Organization: A noiseless patient Spider Message-ID: References: Reply-To: nonlegitur@futureapps.de Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 12 Nov 2014 12:55:28 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="b96887e80893c84a90c3007226ca0d1c"; logging-data="21858"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19bYk94jIwGrYbIkT2l9MHxjcWLzbTLMaY=" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 In-Reply-To: Cancel-Lock: sha1:F3/rjlg5nL1+vOo/0POHPcbHQo8= Xref: news.eternal-september.org comp.lang.ada:23165 Date: 2014-11-12T13:55:41+01:00 List-Id: On 12.11.14 11:49, Markus Schöpflin wrote: > > > Well, I would have expected the output to be > > @@@@@6 > @@@@@5 > > But it is: > > @@@@56 > @@@@@5 > > Which is correct according to the definition of overwrite, but > nevertheless I find this extremely surprising. > > Am I alone in this? No, I don't think so. To me it seems that perhaps the LRM is trying to convey mathematical meaning using common sense words: Overwrite involves creating a potentially longer string and then dropping characters from that new string, either left or right. In doing so, the procedure needs to abstractly overwrite at positions before Position, which is odd.