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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,999172cfe4113340 X-Google-Attributes: gid103376,public 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 Message-ID: <884kis$9281@news.cis.okstate.edu>#1/1 X-Deja-AN: 585115589 References: <87pgm3$o3p$1@nnrp1.deja.com> <87pmrq$9ae1@news.cis.okstate.edu> <87s8s3$aai1@news.cis.okstate.edu> <38A5C749.5C78D952@earthlink.net> Organization: Oklahoma State University User-Agent: slrn/0.9.6.2 (Linux) Reply-To: dstarner98@aasaa.ofe.org Newsgroups: comp.lang.ada Date: 2000-02-12T00:00:00+00:00 List-Id: On Sat, 12 Feb 2000 21:50:33 GMT, Jeff Carter 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