From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Ada.Strings.Unbounded vs Ada.Containers.Indefinite_Holders
Date: Sat, 23 Sep 2017 11:16:59 +0200
Date: 2017-09-23T11:16:59+02:00 [thread overview]
Message-ID: <oq58qb$o3s$1@dont-email.me> (raw)
In-Reply-To: <oq54sk$1uf3$1@gioia.aioe.org>
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
next prev parent reply other threads:[~2017-09-23 9:16 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-21 18:14 Ada.Strings.Unbounded vs Ada.Containers.Indefinite_Holders Victor Porton
2017-09-21 21:30 ` AdaMagica
2017-09-22 12:16 ` Victor Porton
2017-09-22 19:25 ` Simon Wright
2017-09-22 22:15 ` Victor Porton
2017-09-23 8:09 ` Dmitry A. Kazakov
2017-09-23 9:16 ` Jeffrey R. Carter [this message]
2017-10-03 0:15 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox