caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* RE: [Caml-list] Checked exceptions and type inference
@ 2003-03-12  3:00 Arturo Borquez
  2003-03-12  3:24 ` Nicolas Cannasse
  2003-03-12  3:43 ` mgushee
  0 siblings, 2 replies; 11+ messages in thread
From: Arturo Borquez @ 2003-03-12  3:00 UTC (permalink / raw)
  To: caml-list

Brian Hurt <brian.hurt@qlogic.com> wrote:

>
>Reading LtU I came across this article:
>http://www.octopull.demon.co.uk/java/ExceptionalJava.html
>
>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?
>

Regards.

-- 
Arturo Borquez


__________________________________________________________________
Try AOL and get 1045 hours FREE for 45 days!
http://free.aol.com/tryaolfree/index.adp?375380

Get AOL Instant Messenger 5.1 for FREE! Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promos=380455

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread
* [Caml-list] Checked exceptions and type inference
@ 2003-03-11 21:50 Brian Hurt
  2003-03-12  5:40 ` Jacques Garrigue
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Brian Hurt @ 2003-03-11 21:50 UTC (permalink / raw)
  To: Ocaml Mailing List


Reading LtU I came across this article:
http://www.octopull.demon.co.uk/java/ExceptionalJava.html

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.

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?

Brian


-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2003-03-12 20:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-12  3:00 [Caml-list] Checked exceptions and type inference Arturo Borquez
2003-03-12  3:24 ` Nicolas Cannasse
2003-03-12  3:43 ` mgushee
  -- strict thread matches above, loose matches on Subject: below --
2003-03-11 21:50 Brian Hurt
2003-03-12  5:40 ` Jacques Garrigue
2003-03-12  8:45 ` Xavier Leroy
2003-03-12 10:12   ` Stefano Zacchiroli
2003-03-12 16:34     ` Xavier Leroy
2003-03-12 17:20 ` Richard W.M. Jones
2003-03-12 20:49   ` Brian Hurt
2003-03-12 18:45 ` William Chesters

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).