NICE-ESG-Libs Digest        Wed,  7 Jun 95       Volume 1 : Issue 245 

Today's Topics:
                          State in STD_FILES


NICE Eiffel Standards Group -- Library Committee Mailing List To post to list: NICE-ESG-Libs@atlanta.twr.com To send mail to the Chairman of the committee: NICE-ESG-Libs-chair@atlanta.twr.com Administrative matters (sign up, unsubscribe, mail problems, etc): NICE-ESG-Libs-request@atlanta.twr.com
Date: Wed, 7 Jun 1995 09:19:29 +0100 (BST) From: S M Fisher <S.M.Fisher@letterbox.rl.ac.uk> Subject: State in STD_FILES To: NICE ESG Library Committee <NICE-ESG-Libs@atlanta.twr.com> In response to Steve Tynor's comment, it had not occured to me that one can write explicitly: io.error.put_integer(1) rather than io.set_error_default io.put_integer(1) However this leaves the problem that any other piece of code which uses io.put_xxx will get a suprprise as it will now write to stderr rather than stdout, because STD_FILES has a state variable. I would much rather write: stderr.put_integer(1) The other observation is that an input stream and an output stream have not a single feature in common, though the standard output and the error output would have identical features. I would split STD_FILES into 3 classes say STDERR, STDOUT and STDIN (STDOUT and STDERR could inherit from another class) and have once functions in GENERAL to give `stdout', `stdin' and `stderr' instead of `io'. Otherwise the user is forced to store the state or always use the full io.output.put_xxx form, which I find inelegant. Steve F.