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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,8f802583e5c84fa X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeedt0.toon.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsfeed.arcor.de!news.arcor.de!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: String filtering Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.14.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <1j92wa9843ylq.16j89wuqatbaj$.dlg@40tude.net> <433924a2$1_1@glkas0286.greenlnk.net> <43392732$1_1@glkas0286.greenlnk.net> <1jd30obyohnp6$.41tz3funikly.dlg@40tude.net> <43394a3e$1_1@glkas0286.greenlnk.net> Date: Tue, 27 Sep 2005 16:24:01 +0200 Message-ID: NNTP-Posting-Date: 27 Sep 2005 16:24:06 MEST NNTP-Posting-Host: 580109e8.newsread2.arcor-online.net X-Trace: DXC=5`Rag_Un0XWkVRFeeUa4iQQ5U85hF6f;TjW\KbG]kaMXGSi?jHD8GOPKbZj=[82b9V[6LHn;2LCV^7enW;^6ZC`T<=9bOTW=MN^ X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:5196 Date: 2005-09-27T16:24:06+02:00 List-Id: On Tue, 27 Sep 2005 14:42:02 +0100, Martin Dowie wrote: > Dmitry A. Kazakov wrote: >> No. ARM 95 A.4.5(49) reads: >> >> "...If an object of type Unbounded_String is not otherwise >> initialized, it will be initialized to the same value as >> Null_Unbounded_String." > > But it was "otherwise initialized": > > := To_Unbounded_String(Count(Str, Alphanumeric_Set)); > > 2nd sentence of ARM 95 A.4.5 (76) reads: > > "The function To_Unbounded_String(Length : in Natural) > returns an Unbounded_String that represents an uninitialized > String whose length is Length." Ah, now I see what you meant! Right, though my point was that one should use either New_Str : String (1...Count (...)); or New_Str : Unbounded_String; -- "Uninitialized" So my comment about empty string concerned the latter case. If To_Unbounded_String (Count) is ever used then of course Replace_Element should be in place of assignment + Append. Because, assignment might reclaim the memory allocated by To_Unbounded_String (Count). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de