[mercury-users] io output exceptions
Ralph Becket
rafe at cs.mu.OZ.AU
Thu Nov 14 16:00:32 AEDT 2002
Michael Day, Thursday, 14 November 2002:
>
> Why do the io output predicates throw exceptions instead of returning an
> io__res to indicate error conditions?
Because errors on output are really exceptional :-)
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.
One does not expect results from an output operation and it would make
code look much more awkward if one had to explicitly check for output
errors after every such operation.
- Ralph
--------------------------------------------------------------------------
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