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-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,NICE_REPLY_A autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: Empty String confusion; Positive and Natural Date: Mon, 29 Nov 2021 19:05:21 +0100 Organization: A noiseless patient Spider Message-ID: References: <053c8a45-2829-4f2e-925c-b72308c1fe61n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 29 Nov 2021 18:05:21 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="670b459fad2f9af77ded0cc30bb39b80"; logging-data="16603"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+8wFIVrYBfPeBDU+mNAIWPrGCIONTMZr8=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.1 Cancel-Lock: sha1:KgYehkYVqAK1mEemQfquVcZAbcg= In-Reply-To: <053c8a45-2829-4f2e-925c-b72308c1fe61n@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:63162 List-Id: On 2021-11-29 18:34, Kevin Chadwick wrote: > > If something goes wrong and I run the create function with "" then the strings length is zero. Why is a string type Positive and not Natural, because empty strings are in fact useless? I don't understand what you're asking. 'Length returns universal_integer; it is independent of the index subtype. The index subtype can even be non-numeric. -- Jeff Carter Programming by extension, emphasizing, as it does, ease of writing over ease of reading, should be avoided whenever possible by S/W engineers, and used with the same reluctance and care that they give to gotos and access types. 175