Version française
Home     About     Download     Resources     Contact us    
Browse thread
Today's inflamatory opinion: exceptions are bad
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] Today's inflamatory opinion: exceptions are bad
On Sunday 10 December 2006 03:35, Chris King wrote:
> > My point here is this: Ocaml is not Java (a fact we should all be
> > gratefull for, IMHO).  Simply because Java and C++ do something, doesn't
> > mean that it's a good thing to do.
>
> One thing Java (sort of) gets right is keeping track of which
> exceptions a function can throw, making it easy to ensure that some
> deeply nested piece of code won't cause the entire application to die
> from some obscure exception.  I'd love to see a similar feature in
> O'Caml, whereby the exceptions which a function can raise are part of
> its type and are inferred and checked by the compiler.

This has been done. There was a tool called ocamlexc that did whole-program 
analysis to find out which exceptions could propagate where. However, it 
wasn't useful enough to be kept up to date.

  http://caml.inria.fr/pub/old_caml_site/ocamlexc/ocamlexc.htm

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists