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.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!A.SEI.CMU.EDU!Nelson.Weiderman From: Nelson.Weiderman@A.SEI.CMU.EDU Newsgroups: net.lang.ada Subject: Answer about text_io Message-ID: <8604171925.AA03101@ucbvax.berkeley.edu> Date: Thu, 17-Apr-86 13:12:49 EST Article-I.D.: ucbvax.8604171925.AA03101 Posted: Thu Apr 17 13:12:49 1986 Date-Received: Sat, 19-Apr-86 14:27:30 EST Sender: usenet@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: 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.