[mercury-users] io output exceptions
Michael Day
mikeday at yeslogic.com
Thu Nov 14 16:31:21 AEDT 2002
> (1) I/O errors are rare
> (2) Throwing an exception is usually the right action.
In that case, why don't input operations throw exceptions?
Ralph says:
"One expects a result from an input and has to be prepared for at least
success and eof, so also handling error cases that way seems natural."
but it does complicate parsing code as you end up with three branches
after every operation instead of two.
Michael
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list