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 XAA27995; Fri, 14 Jun 2002 23:23:41 +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 XAA27925 for ; Fri, 14 Jun 2002 23:23:40 +0200 (MET DST) Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5ELNcP29708; Fri, 14 Jun 2002 23:23:39 +0200 (MET DST) Received: from central-city-carrier-station.mit.edu (CENTRAL-CITY-CARRIER-STATION.MIT.EDU [18.7.7.72]) by fort-point-station.mit.edu (8.9.2/8.9.2) with ESMTP id RAA06211; Fri, 14 Jun 2002 17:23:38 -0400 (EDT) Received: from manawatu-mail-centre.mit.edu (MANAWATU-MAIL-CENTRE.MIT.EDU [18.7.7.71]) by central-city-carrier-station.mit.edu (8.9.2/8.9.2) with ESMTP id RAA25813; Fri, 14 Jun 2002 17:23:37 -0400 (EDT) Received: from psi-phi.mit.edu (PSI-PHI.MIT.EDU [18.187.1.35]) by manawatu-mail-centre.mit.edu (8.9.2/8.9.2) with ESMTP id RAA28976; Fri, 14 Jun 2002 17:23:37 -0400 (EDT) Received: (from jfc@localhost) by psi-phi.mit.edu (8.9.3) id RAA10195; Fri, 14 Jun 2002 17:23:36 -0400 Message-Id: <200206142123.RAA10195@psi-phi.mit.edu> To: Xavier Leroy cc: caml-list@inria.fr Subject: Re: [Caml-list] Catching exceptions into strings In-Reply-To: Your message of "Tue, 11 Jun 2002 17:37:26 +0200." <20020611173726.A14277@pauillac.inria.fr> Date: Fri, 14 Jun 2002 17:23:36 -0400 From: John Carr Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > > , why isn't the compiler simply inserting the check for them > > This is a reasonable option -- much more reasonable than trying to > intercept the SIGFPE signal and somehow turn it into an exception. > I still have doubts that reporting division by zero via an exception > is really useful, though. I don't see the problem with translating SIGFPE into an exception. The same technique is used for bounds checking. On SPARC/Solaris SIGILL becomes an array bounds error. To handle SIGFPE similarly requires about five lines of code per platform in asmrun/signals.c plus about 20 lines of code in asmrun/fail.c to generate the appropriate exception. If the language defines a divide-by-zero exception then the runtime should generate the exception. I can think of only one reason not to do so on a platform where division by zero results in a signal: the core dump may be easier to debug than an uncaught exception. (How about a stack trace on error for compiled code?) --John Carr (jfc@mit.edu) ------------------- 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