From: Nelson.Weiderman@A.SEI.CMU.EDU
Subject: Answer about text_io
Date: Thu, 17-Apr-86 13:12:49 EST [thread overview]
Date: Thu Apr 17 13:12:49 1986
Message-ID: <8604171925.AA03101@ucbvax.berkeley.edu> (raw)
We have recently had the same difficulty reading enumerated data types
and we also initially thought it was a problem with our compiler (John
Goodenough please take note). The answer to the riddle appears in ARM
paragraph 14.3.5(5). As long as the user enters characters which are
valid in an enumeration literal, there are no problems (this seems to be
the unstated assumption in both Booch and the ARM examples cited). If the
user enters an invalid character such as a "." or ";" then the last
sentence of the cited paragraph comes into effect -- "The character or
line terminator that causes input to cease remains available for
subsequent input." Hence the infinite loop. Thus the examples are not
as robust as they first appear, but the compilers are acting correctly.
reply other threads:[~1986-04-17 18:12 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox