Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] GC and file descriptors
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Martin Berger <martinb@d...>
Subject: Re: [Caml-list] GC and file descriptors
Brian Hurt wrote:

> The single change the programmer would have to make in this case is to add 
> a new error case that is not being handled.  In which case the compiler is 
> being nice and telling you all the places where you need to think about 
> how to handle this new error case.

this can be immensely useful, but also very infuriating, depending on where
you are in the software development cycle.

imagine having 100000 lines of code, mostly mature, and you are trying to
track down a little bug. for that you want to see with what arguments the
function

    let f m n =
       body;;

is called. assume that function has the type

    f : int -> ( int -> A throws E ) throws E

so for debugging you modify f to

    let f m n =
       print_debug "calling f with arguments " m n;
       body

if print_debug may throw something not in E and if f is used all over
your code, you will have make an enourmous of changes (and later revert
them) just to get a silly little debugging mechanism going. i would hate
having to do this.  being able to switch off exception would be a great
help in this situation.

being able to switch on or off exception checking is just an instance of
a more general phenomenon where you run different checks on your software
independently of each other. i expect future compilers to be more flexible
in this regard, maybe offering plug-in typing systems from untyped to
fully fledged dependent types and proof annotations.

martin

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