From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: problemn with string'last Date: Fri, 5 May 2023 14:08:06 +0200 Organization: A noiseless patient Spider Message-ID: References: <2bc1705c-7802-4e89-960f-9b566d376f3cn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 5 May 2023 12:08:06 -0000 (UTC) Injection-Info: dont-email.me; posting-host="a821bf7691719301ca9d9a37230ed4e3"; logging-data="2371684"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+4R81AI3CxoJ68/Gu6thKy7cAY9AG75n4=" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.1 Cancel-Lock: sha1:pbpeISn1B4NQPw/RYH3om10XJ48= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:65174 List-Id: On 2023-05-05 13:17, Jeffrey R.Carter wrote: > However, it's important to remember that 'Last is not necessarily the > same as 'Length because 'First is not necessarily one. This is > especially important in subprograms that take String parameters, as they > are often passed slices. Non-sliding indices is one of the most useful Ada features. You can pass indices around as-is, which is extremely helpful when processing strings. You will also find that actually 'Length and 'Last have different types, which is quite useful as well. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de