Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Uncaught exceptions (or am I going crazy?)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Yaron M. Minsky <yminsky@C...>
Subject: Re: [Caml-list] Uncaught exceptions (or am I going crazy?)
All the explanations given so far make sense except for one thing:  they 
all suggest that the program should terminate.  But my program doesn't 
terminate, it just prints out the "Uncaught exception" string and keeps 
on executing.  I am not to my knowledge making any use of threads, so 
that odesn't seem like it should be the right explanation either.

So, any more thoughts?

y

Didier Le Botlan wrote:
> ( << J'ai ! >> )
> 
> Try this one :
> 
> let arr = Array.create 5 " a cell "
> let _ = print_string arr.(0) ; print_string arr.(10) ;;   
> 
> 
> I get << a cell Fatal error: exception Invalid_argument("Array.get") >>
> It's a feature ! Reading a cell outside an array raises an exception and
> prints it on the screen.
> Similarly, when a pipe is closed, a system exception is raised.
> Since you do not catch the exception with a 'try ... with Sys_error m ->
> ...' block, you get the message on stderr, that is on your screen.
> 
> Does it answer your question ?
> 
> 
> "Yaron M. Minsky" a écrit :
> 
>>I'm getting some very weird behavior ...
>>What's so strange about this is that as far as I can tell, there is no
>>place in my code where I actually print out such errors.
> 



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