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 KAA28958; Wed, 12 Jun 2002 10:16:46 +0200 (MET DST) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA28815 for caml-list@pauillac.inria.fr; Wed, 12 Jun 2002 10:16:45 +0200 (MET DST) 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 XAA20644 for ; Tue, 11 Jun 2002 23:19:16 +0200 (MET DST) Received: from obento.cs.caltech.edu (obento.cs.caltech.edu [131.215.44.101]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g5BLJCH27934; Tue, 11 Jun 2002 23:19:14 +0200 (MET DST) Received: from orchestra.cs.caltech.edu (orchestra.cs.caltech.edu [131.215.44.20]) by obento.cs.caltech.edu (Postfix) with ESMTP id 8C388400D; Tue, 11 Jun 2002 14:19:10 -0700 (PDT) Received: (from mvanier@localhost) by orchestra.cs.caltech.edu (8.11.6/8.9.3) id g5BLJAZ14026; Tue, 11 Jun 2002 14:19:10 -0700 Date: Tue, 11 Jun 2002 14:19:10 -0700 Message-Id: <200206112119.g5BLJAZ14026@orchestra.cs.caltech.edu> X-Authentication-Warning: orchestra.cs.caltech.edu: mvanier set sender to mvanier@cs.caltech.edu using -f From: Michael Vanier To: xavier.leroy@inria.fr Cc: chase@world.std.com, caml-list@inria.fr In-reply-to: <20020611173726.A14277@pauillac.inria.fr> (message from Xavier Leroy on Tue, 11 Jun 2002 17:37:26 +0200) Subject: Re: [Caml-list] Catching exceptions into strings References: <20020611092333.GJ7647@adelscott.lanetcie.com> <5.1.0.14.0.20020611092123.027cbb48@pop.theWorld.com> <20020611173726.A14277@pauillac.inria.fr> Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Date: Tue, 11 Jun 2002 17:37:26 +0200 > From: Xavier Leroy > > > That's really rather surprising. Given that the manual recommends that > > users explicitly check for zero to avoid this exception > > The manual suggests that instead of writing > > try x / y with Division_by_zero -> ... > > you could also write > > if y = 0 then ... else x / y > > and not only avoid the issue, but end up with clearer code as well. > However, this kind of transformation isn't always applicable. > > > , 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. > Why is it unfeasible to intercept the SIGFPE signal? Those of us who do numeric computation would really appreciate this capability. Mike ------------------- 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