[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ooc-980713 & oo2c-1.3.8



> From: Michael van Acken <mvacken@t-online.de>
> > From: "Eric W. Nikitin" <enikitin@apk.net>
> > Date: Fri, 24 Jul 1998 09:00:57 -0400 (EDT)
> > Ian Rae <ianrae@istar.ca> wrote:
> > > 1.3.8 works fine for all 3 eol types.
> > >
> > > one small gripe:
> > > ReadLine returns readAfterEnd on the last line of a text
> > > ..snip..
> 
> This can be attributed to the scanner logic of TextRider, and the urge
> of ReadLine to consume the eol sequence.  If there is no eol sequence,
> it does make sense to flag it as an error.
> 
> Besides, ReadLine has to return a `readAfterEnd' sometime, or it will
> get stuck at the end of the file indefinitely.  The only alternative I
> see is to have it return this error only if the last line is empty.
> That is, an input like
> ..snip..
> >
> > (1) says that there is no valid way to read the last line if it is not
> > terminated by an EOL (even though, in the current implementation, S
does
> > contain the value of the last line).  IMO, the spec should be changed
to
> > 
> > 
> > Method: `(R: Reader)' ReadLine `(VAR S: ARRAY OF CHAR)'
> >      Reads a sequence of characters into S; reading continues until an
> >      end-of-line character is encountered, the array S is full, or R
reaches
> >      the end of the channel.  The end-of-line character is discarded
and S
> >      is always terminated with `0X'.
> > 
> >      If R is already positioned at an end-of-line character, 
> >      S returns as an empty string.
> > 
> >      If S is not large enough to hold the entire input, a
> >      `valueOutOfRange' error occurs; S returns with the sequence of
> >      characters that have been read so far (terminated by `0X').
> > 
> >      If R has already reached the end of the channel (i.e., there are
no
> >      more characters left to read), a `readAfterEnd' error occurs and S
> >      returns as an empty string.
> 
> I agree with Eric.  The specs should be changed like this to cover the
> end of file case.
> 

Sounds good.  Thanks again to all involved for their work and ideas over
the 
last month.  I'm ready to release OTT for Bbox in the next few weeks then
it's OTT for V4 -- which should be very interesting to see how things port.

--Ian