[mercury-users] socket support in io

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Oct 5 01:27:41 AEST 1999


On 04-Oct-1999, Robert Ernst Johann JESCHOFNIK <rejj at cat.cs.mu.OZ.AU> wrote:
> 
> Along similar lines, is there any good reason that the predicate error/1
> is defined in the module "require"?

Probably not.

Do you have any suggestions for what module it should go in?

> For a while I kept forgetting that I had to import "require" for the
> following to work..
> 
> 	% Res is an io__result(T)
> 	(
> 	    Res = error(Error),
> 	    io__error_message(Error, Msg),
> 	    error(Msg)
> 	;
> 	...
> 	)

Incidentally, using the exception handling support, which in our latest
development release is part of the standard library, that might be better
written as

 	% Res is an io__result(T)
 	(
 	    Res = error(Error),
 	    throw(Error)
 	;
 	...
 	)

Here `throw' is defined in the `exception' module --
hopefully for that one at least the module name is a bit more intuitive ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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