comp.lang.ada
 help / color / mirror / Atom feed
From: dvdeug@x8b4e53cd.dhcp.okstate.edu (David Starner)
Subject: Re: Character vs. String comparisons (was: Re: How to implement a continue  statement in Ada?)
Date: 2000/02/12
Date: 2000-02-12T00:00:00+00:00	[thread overview]
Message-ID: <884kis$9281@news.cis.okstate.edu> (raw)
In-Reply-To: 38A5C749.5C78D952@earthlink.net

On Sat, 12 Feb 2000 21:50:33 GMT, Jeff Carter <jrcarter010@earthlink.net> wrote:
>David Starner wrote:
>> elsif char (1) = '(' and char (2) = '*' then
>
>Is there some reason you didn't write
>
>elsif char (1 .. 2) = "(*";

Yes. It actually looked like 
   elsif char (I + 1) = '(' and then char (I + 2) = '*' then ...
The way the buffer was set up, the trailing character would always be
a space. As long as anything didn't read past a space, I don't have
to take the extra code to check that I < EOL. char (I+1 .. I + 3) = 'for'
could potentially overflow the buffer, whereas char(I+1) = 'f' and then
char (I+2) = 'o' and then char (I + 3) = 'r' won't. Also, it looked like
elsif char (I+1) = '(' then
   if char (I+2) = '*' then
      -- Do comment things
   else
      -- Do open parenthesis things
   end if;
...
-- 
David Starner - dstarner98@aasaa.ofe.org
Only a nerd would worry about wrong parentheses with
square brackets. But that's what mathematicians are.
   -- Dr. Burchard, math professor at OSU




  reply	other threads:[~2000-02-12  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-08  0:00 How to implement a continue statement in Ada? Oliver Kellogg
2000-02-08  0:00 ` David Starner
2000-02-08  0:00   ` Aidan Skinner
2000-02-09  0:00     ` Ted Dennison
2000-02-12  0:00       ` Jeff Carter
2000-02-14  0:00       ` Oliver Kellogg
2000-02-09  0:00     ` David Starner
2000-02-10  0:00       ` Aidan Skinner
2000-02-12  0:00       ` Character vs. String comparisons (was: Re: How to implement a continue statement in Ada?) Jeff Carter
2000-02-12  0:00         ` David Starner [this message]
2000-02-08  0:00 ` How to implement a continue statement in Ada? Ted Dennison
2000-02-09  0:00   ` Roger Barnett
replies disabled

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