caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Louis Gesbert <louis.gesbert@laposte.net>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Bugs with pattern-matching and exceptions
Date: Wed, 01 Mar 2006 12:10:21 +0100	[thread overview]
Message-ID: <f64914aa6debca404f0f005cd2dcac42@myco.ath.cx> (raw)
In-Reply-To: <200602281333.52448.jon@ffconsultancy.com>

> Can you reproduce this failure of the type system in the top-level
> without using marshalling? I haven't been able to.

Yes, this was without marshalling: when you use an alias to an exception
which has been redefined afterwards, some type information seems to be lost
by the top-level.

# type t = X;;
type t = X
# exception E of t;;
exception E of t
# exception E' = E;;
exception E' of t
# E' X;;
- : exn = E X
# exception E of string;;
exception E of string
# E' X;;
- : exn = E 0

Here we alias E with E', then redefine E (no matter with what), and E'
shows its argument as int... However, this seems to be only a problem with
the toplevel pretty-printer, not a real type problem since I didn't manage
to make O'Caml accept badly typed expressions this way. This is with O'Caml
3.09.1.

I guess this is linked to the problems of equality and marshalling:
exceptions are non-standard variant types which confuse the run-time in
some dark corners.


  parent reply	other threads:[~2006-03-01 11:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-28 12:29 Louis Gesbert
2006-02-28 15:51 ` [Caml-list] " Alain Frisch
2006-03-01  0:03 ` Jacques Garrigue
2006-03-01  7:00   ` Alain Frisch
     [not found] ` <200602281333.52448.jon@ffconsultancy.com>
2006-03-01 11:10   ` Louis Gesbert [this message]
2006-03-01 23:07 Louis Gesbert
2006-03-02  6:47 ` Alain Frisch
2006-03-03  9:02   ` Louis Gesbert

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=f64914aa6debca404f0f005cd2dcac42@myco.ath.cx \
    --to=louis.gesbert@laposte.net \
    --cc=caml-list@inria.fr \
    --cc=jon@ffconsultancy.com \
    /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).