caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: "Michaël Le Barbier" <michael.le_barbier@laposte.net>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Preferred use of Invalid_argument and Failure
Date: Wed, 24 Oct 2007 09:06:58 +0200	[thread overview]
Message-ID: <471EEF12.60203@frisch.fr> (raw)
In-Reply-To: <867ildqacq.fsf@Llea.celt.neu>

Michaël Le Barbier wrote:
> I am working on a library, I want the interfaces to look like standard
> library modules interfaces.
...
> Again, I would be glad to get advices of discipline in using
> theses two exceptions. What works for you?

My advice would be not to use these two exceptions and to define custom 
exceptions in your library. You'll be able to pattern match on them 
more easily and to store extra relevant information. Of course, this 
breaks your design constraint of looking like the standard library.

-- Alain


  reply	other threads:[~2007-10-24  7:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24  6:45 Michaël Le Barbier
2007-10-24  7:06 ` Alain Frisch [this message]
2007-10-24  8:06 ` [Caml-list] " Xavier Leroy
2007-10-24 11:05   ` Yaron Minsky
2007-10-24 11:30     ` Joel Reymont
2007-10-24 13:15       ` Yaron Minsky
2007-10-24 13:22         ` Daniel Bünzli
2007-10-24 14:45           ` Jon Harrop
2007-10-24 15:10           ` Richard Jones
2007-10-24 14:44         ` Jon Harrop
2007-10-25  7:07   ` Michaël Le Barbier

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=471EEF12.60203@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=michael.le_barbier@laposte.net \
    /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).