[comp.lang.modula2] CanRead, Value and buffering.

rbh@computer-science.nottingham.ac.UK (Roger Henry) (08/20/87)

In message  <648@bingvaxu.cc.binghamton.edu>
Fred Sullivan writes:

> I am trying to figure out how to implement procedures which don't
> consume input, but may have to read far ahead, when the input is for
> example a terminal or a pipeline.  Good examples of what I mean are
> Int.CanRead and Int.Value.  Suppose the input is from a terminal, and
> the person sitting at the terminal types an endless stream of spaces.
> Should CanRead return FALSE after filling a buffer?  Should Value halt
> with an error after filling a buffer?  I can't think of anything else
> which would be reasonable, and I'm wondering what the proposers have in
> mind here.

The module BuffIn, in mailing 4 - yet to come, is designed for the
implementation of procedures such as Int.Value.  The specification implies
that non-significant characters (spaces) may be consumed - so the endless
stream of spaces will disappear.

==
Roger Henry
==
Address:
   Computer Science Department,
   University of Nottingham, Nottingham, NG7 2RD, England
Telephone:
   Nottingham (0602 or +44 602) 506101 extension 2855
Electronic Mail Addresses:
   JANET:       rbh@uk.ac.nott.cs
   ARPANET:     rbh%cs.nott.ac.uk@UCL-CS.ARPA
   UUCP:        rbh%cs.nott.ac.uk@ukc.uucp
   BITNET/EARN: rbh%NOTT.CS@AC.UK