[mercury-users] io output exceptions
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Nov 14 16:02:25 AEDT 2002
On 14-Nov-2002, Michael Day <mikeday at yeslogic.com> wrote:
>
> Why do the io output predicates throw exceptions instead of returning an
> io__res to indicate error conditions?
(1) I/O errors are rare
(2) Throwing an exception is usually the right action.
(3) Handling an error code from these routines would
significantly complicate the code in the caller.
Even a simple "hello world" program would become quite complex.
(4) Because of (3), returning an error code from these
routines would encourage people to ignore such errors.
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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