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=ham 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!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: String filtering References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <7lB_e.605$4h2.105@newsread3.news.pas.earthlink.net> Date: Wed, 28 Sep 2005 18:32:35 GMT NNTP-Posting-Host: 67.3.216.51 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1127932355 67.3.216.51 (Wed, 28 Sep 2005 11:32:35 PDT) NNTP-Posting-Date: Wed, 28 Sep 2005 11:32:35 PDT Xref: g2news1.google.com comp.lang.ada:5246 Date: 2005-09-28T18:32:35+00:00 List-Id: David Trudgett wrote: > Yes, it does seem odd. As it happens, the code is easier and shorter > that way, but <> might free > storage in some implementations, so I created a new version using > Replace_Element instead. Well, no (if I interpret your use of "that way" the same way you meant it). It's shorter and easier to use the default initial value of null string, and then Append to it. Initializing it to an uninitialized string of the known result length, then replacing that by a null string, and then appending, is longer, harder, and makes the reader stop and say "Huh?" Your version using Replace_Element is more along the lines that I was suggesting. > Repeated deletes would cause a lot of copying (though not a problem > for my particular purposes at present). Probably (a version based on a linked list of Characters would be optimized for Delete, but less than optimal for other operations :). The question is which version is clearest for your system. If the clean up in place is the clearest, then you have the questions of what the timing requirements are for your system, and whether using Delete causes the system to fail to meet those requirements. > Now, go away or I shall taunt you a second time! ;-) Taunt away! I'm not planning on going anywhere, obnoxious French chevalier! -- Jeff Carter "You tiny-brained wipers of other people's bottoms!" Monty Python & the Holy Grail 18