[mercury-users] Puzzled about about I/O in predicates which may fail
Ralph Becket
rafe at cs.mu.OZ.AU
Wed Nov 24 13:51:34 AEDT 2004
Gregory D. Weber, Tuesday, 23 November 2004:
> It seems to me that by using state variables, I can "fix" an
> error involving I/O in predicates which may fail.
> If read_problem_decl_semidet is indeed semidet, then
>
> (EXAMPLE 1)
>
> main(!IO) :-
> (
> read_problem_decl_semidet("credit.decl", Problem, !IO) ->
> describe_problem(Problem, !IO)
> ;
> io__print("Error reading file\n", !IO)
> ).
>
> compiles without any error message. Moreover, running the program
> actually works!
This is a bug! Thank you for reporting it; I'll look into what's going
on as soon as I get a few spare minutes.
-- 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