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=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT 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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Surprising behaviour of strings.fixed.overwrite Date: Wed, 12 Nov 2014 17:19:03 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: 24-196-82-226.static.mdsn.wi.charter.com X-Trace: loke.gir.dk 1415834344 30903 24.196.82.226 (12 Nov 2014 23:19:04 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 12 Nov 2014 23:19:04 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:23193 Date: 2014-11-12T17:19:03-06:00 List-Id: "Markus Schöpflin" wrote in message news:m3vdvn$uu$1@speranza.aioe.org... > Given the following Ada program: ... > Which is correct according to the definition of overwrite, but > nevertheless I find this extremely surprising. I suppose, but so what? It's not like we could change the meaning of this routine (or any routine in Ada.Strings), as doing so would potentially silently break existing code. IMHO, the vast majority of Ada.Strings.Fixed routines are rather nonsense. I think they exist so that there are counterparts to the routines in Ada.Strings.Unbounded, but there's rarely much reason to use them rather than just using an appropriate slice. I personally use Ada.Strings.Fixed for Index and sometimes Translate or Move, and that's about it. Everything else I do with slices or loops (admittedly, I started doing that back in the Ada 83 days before Ada.Strings.Fixed existed, and there doesn't seem to be much reason to change). I find that I have to look up the definition (both the name, the parameters, and the semantics) for any other routine, and by the time I've done that, I could have written a slice that would generally be faster and smaller anyway. Randy. Randy.