[mercury-users] exceptions considered bloody annoying

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Apr 16 21:09:22 AEST 2002


On 16-Apr-2002, Michael Day <mikeday at bigpond.net.au> wrote:
> 
> Logic programming languages already have transactional integrity in the
> absence of destructive update. I can write semidet predicates that
> manipulate lists and they can backtrack on failure and preserve the
> original input and everything is fine, but when I want to manipulate io
> states to send bytes through the network it's hard for the language to
> undo that operation for me automatically when I change my mind.
> 
> As soon as you start destructively updating unique structures you're back
> in C++ land and you can't abandon a line of computation without losing
> your data. But exceptions give you the idea that you can, that you can
> just throw one and it's like backtracking and everything will be alright.

I'm not sure what gave you that idea.  But if there is a problem here,
it sounds more like a problem with education and/or documentation rather
than a problem with the language or library design.

> Here is a proposal: remove try and try_io from the library.

I don't see what that would accomplish.
If you don't like those predicates, you don't have to use them!

-- 
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