caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: tab@snarc.org (Vincent Hanquez)
To: "Bünzli Daniel" <daniel.buenzli@erratique.ch>
Cc: caml-list List <caml-list@inria.fr>
Subject: Re: [Caml-list] [OSR] Exceptionless error management, take 2
Date: Sun, 10 Feb 2008 13:35:12 +0100	[thread overview]
Message-ID: <20080210123512.GB11897@snarc.org> (raw)
In-Reply-To: <AE07C5D5-7AF5-418B-80B0-06E1441E651D@erratique.ch>

On Fri, Feb 08, 2008 at 01:40:09PM +0100, Bünzli Daniel wrote:
> Only if they have exactly the same error cases (in which case they are very 
> likely to attach the same semantics to it). I think you fail to think 
> realisitically, chances are little that this is going to pose any problems 
> in practice.

with growing use of polymorphic variant everywhere, like lots of people
suggest, i can see the number of "collision" raising quickly. specially
defining for regular usage stuff like `Error `Succeed, very common
stuff.

> Do you redefine the option type in each of your modules to be 
> able to say this is an optional integer from module X ?

no, for the simple reason that the option type is (almost) a built-in
type. it could be abuse yes, but everyone knows it's a shared type. like
integer or string.

the "integer 1" is the same in every module, the "error of integer 1" is
probably different.

for example,
in unix: "Error of 1" would means EPERM
in xml: "Error of 1" would means error line 1.

If you working with normal variant, the compiler knows it can't compare
Unix.Error and Xml.Error even though they have the same type attached
(an integer). with polymorphic variant, there's only "`Error of integer"
in both module, so for the compiler they are the same.

>> If I use normal variant, the compiler will prevent me using the same code 
>> to match a X.Error and a Y.Error.
>
> Note that with this take 2 proposal -- that I personnaly find too invasive 
> and heavy weight  -- you won't get that, you will have to match on 
> Error.Error (!) instead of `Error (take 1).

it all boils down in where the thing is going to end up or how it's
going to be use.

-- 
Vincent Hanquez


  parent reply	other threads:[~2008-02-10 12:35 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 [this message]
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
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=20080210123512.GB11897@snarc.org \
    --to=tab@snarc.org \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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).