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=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!aioe.org!8nKyDL3nVTTIdBB8axZhRA.user.46.165.242.75.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Empty String confusion; Positive and Natural Date: Tue, 30 Nov 2021 08:21:28 +0000 Organization: Aioe.org NNTP Server Message-ID: References: <053c8a45-2829-4f2e-925c-b72308c1fe61n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: gioia.aioe.org; logging-data="43322"; posting-host="8nKyDL3nVTTIdBB8axZhRA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin) X-Notice: Filtered by postfilter v. 0.9.2 Cancel-Lock: sha1:itvtFY15bSgZykc0oai+RTVIAto= Xref: reader02.eternal-september.org comp.lang.ada:63167 List-Id: 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