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
[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: 2003-11-19 (11:44)
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

    let f m n =

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;

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.


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