[mercury-users] Exception handling documentation.
Julien Fischer
juliensf at csse.unimelb.edu.au
Thu Jul 17 17:13:04 AEST 2008
On Thu, 17 Jul 2008, Paul Bone wrote:
> On Thu, Jul 17, 2008 at 03:43:02PM +1000, Julien Fischer wrote:
>>
>> On Thu, 17 Jul 2008, Paul Bone wrote:
>>
>>> On Thu, Jul 17, 2008 at 02:30:30PM +1000, Julien Fischer wrote:
>>>>
>>>> On Thu, 17 Jul 2008, Paul Bone wrote:
>>>>
>>>>>
>>>>> io.close_output throws an exception if bad stuff happens. I don't see
>>>>> any information in the language reference guide about exceptions, this
>>>>> is probably a bug.
>>>>
>>>> exceptions are a library feature so they are documented in the library
>>>> reference guide. (The reference manual of course documents the
>>>> determinism erroneous).
>>>
>>> Ah, Found it :-).
>>>
>>>>> Alot of the io package returns errors as part of their return value.
>>>>> Should this be consitant and always return a type that can be used to
>>>>> check for errors?
>>>>
>>>> It is fairly consistent isn't it. Those that throw an exception
>>>> put the error inside of the exception.
>>>
>>> Some throw exceptions and others return values. This is the bit that's
>>> not consitant.
>>>
>>> When I use try_io to try a closure and catch exceptions it requires that
>>> it's parent be cc_multi or multi, and that that predicate's parent is
>>> cc_multi or multi.
>>
>> It requires that it is cc_multi, not multi.
>>
>> I thought that the idea of cc_multi was that it
>>> behaved like det but semantically there could be more solutions that
>>> would _never_ be found.
>>
>> No, semantically there are more solutions but we are *committing* to one.
>> In the case of try_io there are multiple possible I/O states.
>>
>
> How can that help me? I'd like my write predicate to be deterministic so
> I have to throw away the cc_multi somewhere.
>
> I tried putting the call to try_io in a some scope, this didn't work either:
You want a promise_equivalent_solutions scope, not existential
quanification.
Julien.
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to: mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions: mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the users
mailing list