From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA04232; Thu, 3 Oct 2002 09:58:14 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id JAA04248 for caml-list@pauillac.inria.fr; Thu, 3 Oct 2002 09:58:13 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA10012 for ; Wed, 2 Oct 2002 16:59:30 +0200 (MET DST) Received: from beaune.inria.fr (beaune.inria.fr [128.93.8.3]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g92ExUD28285 for ; Wed, 2 Oct 2002 16:59:30 +0200 (MET DST) Received: from beaune.inria.fr by beaune.inria.fr (8.8.8/1.1.22.3/14Sep99-0328PM) id QAA0000000367; Wed, 2 Oct 2002 16:59:29 +0200 (MET DST) Message-ID: <3D9B09CE.5587E656@beaune.inria.fr> Date: Wed, 02 Oct 2002 16:59:26 +0200 From: Didier Le Botlan Organization: INRIA (Projet CRISTAL) X-Mailer: Mozilla 4.75 [fr] (X11; U; Linux 2.2.17-21mdk i686) X-Accept-Language: en MIME-Version: 1.0 To: Ocaml List Subject: Re: [Caml-list] Uncaught exceptions (or am I going crazy?) References: <3D9B03DF.5040806@cs.cornell.edu> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk ( << 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