caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michael Vanier <mvanier@cs.caltech.edu>
To: xavier.leroy@inria.fr
Cc: chase@world.std.com, caml-list@inria.fr
Subject: Re: [Caml-list] Catching exceptions into strings
Date: Tue, 11 Jun 2002 14:19:10 -0700	[thread overview]
Message-ID: <200206112119.g5BLJAZ14026@orchestra.cs.caltech.edu> (raw)
In-Reply-To: <20020611173726.A14277@pauillac.inria.fr> (message from Xavier Leroy on Tue, 11 Jun 2002 17:37:26 +0200)


> Date: Tue, 11 Jun 2002 17:37:26 +0200
> From: Xavier Leroy <xavier.leroy@inria.fr>
> 
> > 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


  parent reply	other threads:[~2002-06-12  8:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-06-10 14:27 Gaurav Chanda
2002-06-10 15:07 ` Xavier Leroy
2002-06-10 21:57 ` Michael Vanier
2002-06-12  8:53   ` Xavier Leroy
2002-06-12  9:36     ` Michael Vanier
2002-06-17 12:48       ` Xavier Leroy
2002-06-17 16:10         ` Ken Rose
2002-06-11  9:23 ` Guillaume Valadon
2002-06-11 13:28   ` David Chase
2002-06-11 15:37     ` Xavier Leroy
2002-06-11 17:44       ` David Chase
2002-06-12  8:33         ` Xavier Leroy
2002-06-11 21:19       ` Michael Vanier [this message]
2002-06-14 21:23       ` John Carr
2002-06-17 12:31         ` Xavier Leroy
2002-06-17 21:08           ` John Carr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200206112119.g5BLJAZ14026@orchestra.cs.caltech.edu \
    --to=mvanier@cs.caltech.edu \
    --cc=caml-list@inria.fr \
    --cc=chase@world.std.com \
    --cc=xavier.leroy@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).