caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain@frisch.fr>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] [Ann] Zarith
Date: Thu, 18 Aug 2011 12:42:31 +0200	[thread overview]
Message-ID: <4E4CEC97.9010202@frisch.fr> (raw)
In-Reply-To: <CAPFanBHyuEpJ4NE61Rdvq2A8PZ4Uuk-inUCXJHO-yrZFDmVtxQ@mail.gmail.com>

On 08/18/2011 10:58 AM, Gabriel Scherer wrote:
> I believe the comparison hardening was made desirable by the expected
> use of first-class modules to encode existential datatypes: with
> existential datatypes you may try to use the polymorphic comparison
> operators on two values of the same (existential) datatype having
> different internal representations. The problem didn't happen with the
> previous encoding of existential types using first-class polymorphism,
> as it implies packing the value inside closures, so the polymorphic
> comparison operators were not usable.

The problem existed before, because of exceptions. When two exception 
values having constructors with the same name are compared with the 
polymorphic equality, their arguments are compared structurally even if 
they don't have the same type.  (One way to address this would be to 
have a special tag on exception values to force physical comparison of 
the constructors.)


-- Alain


      reply	other threads:[~2011-08-18 10:42 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-18  7:34 Xavier Leroy
2011-08-18  8:02 ` rixed
2011-08-18  8:49   ` Gerd Stolpmann
2011-08-18  8:58   ` Gabriel Scherer
2011-08-18 10:42     ` Alain Frisch [this message]

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=4E4CEC97.9010202@frisch.fr \
    --to=alain@frisch.fr \
    --cc=caml-list@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).