[mercury-users] exceptions and cc_multi

Michael Day mikeday at corplink.com.au
Thu Nov 30 09:45:05 AEDT 2000


> The information regarding exceptions seems to be at
> completely the wrong place. For example, Map__det_update/3
> is marked as being 'det' when it could potentially throw an
> exception and break my code/server, whereas the part of the
> program which is 'relatively' safe being protected by an
> exception handler get marked as cc_multi (for me it's the
> Map_det_update/3 which is dangerous, or some new bit of code
> developed by someone else and not the try_io) ? What I need
> from the try_io is to know which errors are potentially
> rethrown (if any). eg.

Sounds like you're asking for exception specifications as found in Java or
C++, where each predicate/function must list explicitly which exceptions
if any it is capable of throwing? Then if predicate A calls predicate B,
and predicate B is capable of throwing software_error, predicate A must
either wrap predicate B in a try or indicate that it is capable of
throwing software_error itself.

I've got no idea what that would do to higher order code though.

Has anyone found exception specifications to be useful in other languages,
or just a pain?

Michael



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