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 Date: Tue, 30 Nov 2021 13:39:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: Empty String confusion; Positive and Natural Content-Language: en-GB Newsgroups: comp.lang.ada References: <053c8a45-2829-4f2e-925c-b72308c1fe61n@googlegroups.com> From: ldries46 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Organization: KPN B.V. Path: eternal-september.org!reader02.eternal-september.org!news.dns-netz.com!news.freedyn.net!newsreader4.netcologne.de!news.netcologne.de!peer03.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe003.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail Injection-Date: Tue, 30 Nov 2021 13:39:28 +0100 Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com" X-Received-Bytes: 1665 Xref: reader02.eternal-september.org comp.lang.ada:63172 List-Id: Op 30-11-2021 om 9:21 schreef Simon Wright: > ldries46 writes: > >> Empty_String : Unbounded_String := To_Unbounded_String(""); > * Given the name, you should probably declare it constant. > > * You don't need to initialize it, ARM 4.5(73) [1] says "If an object of > type Unbounded_String is not otherwise initialized, it will be > initialized to the same value as Null_Unbounded_String". > > * Ada.Strings.Unbounded.Null_Unbounded_String is a constant empty > string. > > [1] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-A-4-5.html#p73 You are right. it should be Empty_String : constant Unbounded_String := To_Unbounded_String("");