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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Ada.Strings.Unbounded vs Ada.Containers.Indefinite_Holders Date: Sat, 23 Sep 2017 11:16:59 +0200 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 23 Sep 2017 09:16:59 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="31981a11f8a3194ef2c8d0bf995a6dfe"; logging-data="24700"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2NsuWfGnMCxuJ1kF2HckOeNsKa8tUn94=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:T3RSpCp4a8JQP2rehAIO9F+GiTo= Xref: news.eternal-september.org comp.lang.ada:48206 Date: 2017-09-23T11:16:59+02:00 List-Id: On 09/23/2017 10:09 AM, Dmitry A. Kazakov wrote: > On 2017-09-23 00:15, Victor Porton wrote: >> >> In my opinion, it would be better to change RM phrasing from "null string" >> to "empty string", because in some other languages (notably C) NULL means >> something other. It is just confusing. > > The adjective null and the noun null are distinct parts of speech. C's noun null > is an abbreviation of null pointer. If pointers can be null so strings can. Another way to look at it: Ada has the formal concepts of: * null access value ARM 4.2(9) * null array 3.6.1(7) * null constraint 3.2(7/2) * null_exclusion 3.10(5.1/2) * null extension 3.9.1(4.1/2) * null procedure 6.7(3/3) * null range 3.5(4) * null record 3.8(15) * null slice 4.1.2(7) * null string literal 2.6(6) * null value (of an access type) 3.10(13/2) * null_statement 5.1(6) not to mention the language-defined identifiers Null_Address in System 13.7(12) Null_Bounded_String in Ada.Strings.Bounded A.4.4(7) Null_Id in Ada.Exceptions 11.4.1(2/2) Null_Occurrence in Ada.Exceptions 11.4.1(3/2) Null_Ptr in Interfaces.C.Strings B.3.1(7) Null_Set in Ada.Strings.Maps A.4.2(5) in Ada.Strings.Wide_Maps A.4.7(5) in Ada.Strings.Wide_Wide_Maps A.4.8(5/2) Null_Task_Id in Ada.Task_Identification C.7.1(2/2) Null_Unbounded_String in Ada.Strings.Unbounded A.4.5(5) (Just look under N in the index.) It's called overloading. Many of these cases refer to things that can have components and mean one with zero components: a null record has no components, a null array has no components ('Length = 0), a null string literal has no characters, a null set has no members, ... It should not be confusing. -- Jeff Carter "You cheesy lot of second-hand electric donkey-bottom biters." Monty Python & the Holy Grail 14