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 RAA03308; Thu, 10 Oct 2002 17:07:37 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA02983 for ; Thu, 10 Oct 2002 17:07:37 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9AF7a524617; Thu, 10 Oct 2002 17:07:36 +0200 (MET DST) Received: from santenay.inria.fr (santenay.inria.fr [128.93.8.59]) by pauillac.inria.fr (8.7.6/8.7.3) with SMTP id RAA02875; Thu, 10 Oct 2002 17:07:35 +0200 (MET DST) Date: Thu, 10 Oct 2002 17:07:35 +0200 From: Maxence Guesdon To: "Scott J," Cc: caml-list@inria.fr Subject: Re: [Caml-list] Runtime overflow and what to do Message-Id: <20021010170735.1d7dbb3a.maxence.guesdon@inria.fr> In-Reply-To: <00bd01c2706d$e7cd68e0$0100a8c0@janxp> References: <00bd01c2706d$e7cd68e0$0100a8c0@janxp> Organization: INRIA X-Mailer: Sylpheed version 0.8.3claws (GTK+ 1.2.10; ) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Thu, 10 Oct 2002 17:01:26 +0200 "Scott J," wrote: > let rec fact n = if n <= 1 then 1 else n * fact (n - 1) ;; You can catch the Stack_overflow exception : try fact 500000 with Stack_overflow -> -1 Is that what you want ? -- Maxence Guesdon ------------------- 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