comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@acm.nospam.org>
Subject: Re: Nested declares, constant size arrays and clarity
Date: Fri, 05 Oct 2007 04:58:06 GMT
Date: 2007-10-05T04:58:06+00:00	[thread overview]
Message-ID: <yvjNi.135993$Fc.50601@attbi_s21> (raw)
In-Reply-To: <1bykilw2jy8k3.1p7sr9xc5wl7i.dlg@40tude.net>

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



  parent reply	other threads:[~2007-10-05  4:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-03 22:58 Nested declares, constant size arrays and clarity Mateusz Papiernik
2007-10-03 23:49 ` Ludovic Brenta
2007-10-04  8:49   ` Mateusz Papiernik
2007-10-04 11:33     ` Ludovic Brenta
2007-10-04 12:45       ` Dmitry A. Kazakov
2007-10-04 13:11         ` Mateusz Papiernik
2007-10-05  5:00           ` Jeffrey R. Carter
2007-10-05  4:58         ` Jeffrey R. Carter [this message]
2007-10-05  7:38           ` Dmitry A. Kazakov
2007-10-05 17:08             ` Jeffrey R. Carter
2007-10-05  4:54     ` Jeffrey R. Carter
2007-10-04  0:20 ` Jeffrey R. Carter
2007-10-04  8:51   ` Mateusz Papiernik
2007-10-05  2:45     ` Steve Whalen
2007-10-04  0:23 ` anon
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox