caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] writing some code using a function for which only the signature is known
Date: Fri, 21 Jan 2011 16:20:26 +0100	[thread overview]
Message-ID: <AANLkTinyF8RBnDrSfw_5WybH1+QdXeKgNPGZeNTETraO@mail.gmail.com> (raw)
In-Reply-To: <1295617774936@names.co.uk>

On Fri, Jan 21, 2011 at 14:49,  <mark@proof-technologies.com> wrote:

> For anything more than toy examples, it's better to use Dmitry's solution of
> a specially defined exception, because you certainly don't want the
> exception to get caught before it reaches the top level, but Assert_failure
> or Failure are liable to get caught if you write code with exception
> handling.

In that case simply use invalid_arg "TODO", Invalid_argument
exceptions should never be catched. This avoids having to define your
own exception.

Best,

Daniel

  reply	other threads:[~2011-01-21 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-21 13:49 mark
2011-01-21 15:20 ` Daniel Bünzli [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-01-21  5:40 Francois Berenger
2011-01-21  5:58 ` oliver
     [not found] ` <AANLkTikv07AgCJXKD_e_QvGGz5245svFGiTG85fpZC7P@mail.gmail.com>
2011-01-21  6:12   ` dmitry grebeniuk
2011-01-21 15:32     ` oliver
2011-01-21 18:26       ` dmitry grebeniuk
2011-01-21 10:56 ` Arlen Cuss

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=AANLkTinyF8RBnDrSfw_5WybH1+QdXeKgNPGZeNTETraO@mail.gmail.com \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@yquem.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).