caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
Date: Thu, 7 Feb 2008 15:33:35 +0000	[thread overview]
Message-ID: <200802071533.35279.jon@ffconsultancy.com> (raw)
In-Reply-To: <1202396482.6084.5.camel@Blefuscu>

On Thursday 07 February 2008 15:01:22 David Teller wrote:
>  As it seems that the first take on exceptionless error management has
> been discarded, I have put together a second candidate. This proposal
> takes into account the discussions from the first candidate, should
> resolve the issues introduced by that first candidate -- and presumably
> open a few other cans of worms somewhere along the way.

There is also some merit in the hierarchical classification of exceptions, 
e.g. as .NET provides (class hierarchies). For example, you might make 
Invalid_argument a base exception with derived exceptions for each of the 
different functions that raise this exception, in order to carry more precise 
information about what exactly went wrong. OCaml's current approach of 
conveying a string argument is not in the API and feels unhygienic as a 
consequence. Like brushing your teeth whilst on the toilet. We all do it, but 
only because we're in a hurry and not because it is an inherently good idea.

Anyway, this can be achieved using variant and polymorphic variant exception 
arguments in OCaml. However, as Zheng Li pointed out late last year, OCaml is 
broken with respect to polymorphic variant exception arguments, e.g. this 
segfaults:

  exception E of [>];; 
  try raise(E`X) with E`X x-> !x

I don't know where the boundary in the language lies, beyond which it is 
unsafe/wrong, so I think it would be constructive to describe this and 
your "exception+polymorphic variant"-related proposal seems like a good place 
to do so.

Just an idea...

-- 
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/products/?e


  parent reply	other threads:[~2008-02-07 15:37 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 15:01 David Teller
2008-02-07 15:09 ` [Caml-list] " Vincent Hanquez
2008-02-07 16:40   ` David Teller
2008-02-07 15:17 ` Jacques Garrigue
2008-02-07 15:22   ` Jon Harrop
2008-02-08  9:54     ` Vincent Hanquez
2008-02-07 15:52   ` David Teller
2008-02-07 16:06     ` Olivier Andrieu
2008-02-07 16:23       ` David Teller
2008-02-08  9:53   ` Vincent Hanquez
2008-02-08 10:52     ` rlehy
2008-02-08 11:56       ` Vincent Hanquez
2008-02-08 12:40         ` Bünzli Daniel
2008-02-08 15:39           ` David Teller
2008-02-08 17:06             ` Eric Cooper
2008-02-08 20:02               ` David Teller
2008-02-08 19:29             ` Bünzli Daniel
2008-02-08 21:13               ` David Teller
2008-02-10 12:35           ` Vincent Hanquez
2008-02-08 19:07     ` Jon Harrop
2008-02-10 11:58       ` Vincent Hanquez
2008-02-10 16:51       ` Matthew William Cox
2008-02-07 15:33 ` Jon Harrop [this message]
2008-02-07 16:25   ` David Teller
2008-02-07 23:10 ` David Teller
2008-02-10 18:47 ` Yaron Minsky
2008-02-10 22:05   ` David Teller
2008-02-11  2:16     ` Yaron Minsky
2008-02-11  8:45       ` David Teller
2008-02-11 12:12         ` Yaron Minsky
2008-02-11 12:53           ` David Teller
2008-02-11 23:09             ` Yaron Minsky

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=200802071533.35279.jon@ffconsultancy.com \
    --to=jon@ffconsultancy.com \
    --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).