Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
RE: [Caml-list] Checked exceptions and type inference
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-12 (03:01)
From: artboreb@n...
Subject: RE: [Caml-list] Checked exceptions and type inference
Brian Hurt <> wrote:

>Reading LtU I came across this article:
>Java treats checked exceptions as part of the type signature of the
>function.  As such, it seems to me that as such, type inference would work
>to propogate most of this information in a more convient way.

>From the manual:
Caml provides exceptions for signalling and handling exceptional conditions. ...

These 'exceptional conditions' do not implies an 'error'
at all, so it might be. Moreover exceptions may have a type
within the context where they occurr. ie:

 let x = try String.sub str pos len with _ -> "" in

in this case failing String.sub is returning a string,
and the type inference system will check it that way.

Perhaps I don't understand what migth be a
'checked exception' in ML. I am missing something?.
can you explain it with an example?

>Checked exceptions actually have their uses, for "errors" which are not
>very exceptional.  Out of memory is highly unexpected.  End of file isn't
>quite as surprising.  Not_found is another that shouldn't be that
>surprising- although that leads to a different religous war.
>Is there any research on using checked exceptions in an ML derived
>language?  Any plans/opinions on implementing checked exceptions in Ocaml?


Arturo Borquez

Try AOL and get 1045 hours FREE for 45 days!

Get AOL Instant Messenger 5.1 for FREE! Download Now!

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: