[m-dev.] try syntax
Peter Wang
novalazy at gmail.com
Thu Jan 22 17:39:56 AEDT 2009
On 2009-01-22, Peter Ross <pdross at gmail.com> wrote:
> On Thu, Jan 22, 2009 at 5:10 PM, Peter Wang <novalazy at gmail.com> wrote:
> >
> > try_io(
> > (pred({X0, Y0, Z0}::out, !.IO::di, !:IO::uo) is det :-
> > f(X0, Y0, Z0, !IO)
> > ), TryResult, !IO),
> > (
> > TryResult = succeeded({X, Y, Z}),
> > on_success(X, Y, Z)
> > ;
> > TryResult = failed,
> > on_failure
> > ;
> > TryResult = exception(E0),
> > ( univ_to_type(E0, _ : exc1) ->
> > on_catch_exc1
> > ; univ_to_type(E0, E) ->
> > rethrow(exception(E))
> > )
> > )
> >
> What would be the behavour if you don't have a catch block that
> succeeds? In other words what goes in the last else in the above
> transformation?
To be decided. I'm leaning towards doing nothing, i.e. "true".
Peter
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions: mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the developers
mailing list