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,d0fa2610a6bea4ec X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!out02a.usenetserver.com!news.usenetserver.com!in01.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!wns13feed!worldnet.att.net!attbi_s21.POSTED!53ab2750!not-for-mail From: "Jeffrey R. Carter" User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Nested declares, constant size arrays and clarity References: <87641n92tc.fsf@ludovic-brenta.org> <87zlyz6rnt.fsf@ludovic-brenta.org> <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net> In-Reply-To: <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 12.201.97.213 X-Complaints-To: abuse@mchsi.com X-Trace: attbi_s21 1191560286 12.201.97.213 (Fri, 05 Oct 2007 04:58:06 GMT) NNTP-Posting-Date: Fri, 05 Oct 2007 04:58:06 GMT Organization: AT&T ASP.att.net Date: Fri, 05 Oct 2007 04:58:06 GMT Xref: g2news2.google.com comp.lang.ada:2313 Date: 2007-10-05T04:58:06+00:00 List-Id: Dmitry A. Kazakov wrote: > > I never use Unbounded_String for parsing. The input line buffer can be > easily reused to accommodate varying strings. The right line boundary would > be not S'Last, but some variable <= S'Last. Alternatively a string slice > can be passed down to the parser. Something like that would be necessary to > do anyway to strip LF/CRs. Except when you have a line longer than S'Length. Better is to use function Ada.Text_IO.Get_Line (Ada 07, but easily implemented in earlier versions; my seminal paper on the subject was in Ada 83 and published in 1989) and always have a string of exactly the right length. -- Jeff Carter "Why, the Mayflower was full of Fireflies, and a few horseflies, too. The Fireflies were on the upper deck, and the horseflies were on the Fireflies." Duck Soup 95