caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@etu.upmc.fr>
To: caml-list@inria.fr
Cc: rossberg@ps.uni-sb.de
Subject: Improper generic equality in Caml (Rossberg's SML vs Caml)
Date: Sat, 16 Sep 2006 20:53:05 +0200 (DST)	[thread overview]
Message-ID: <Pine.A41.4.44.0609162018590.1511520-100000@ibm1> (raw)
In-Reply-To: <20060913091435.537F4AC04@Adric.metnet.fnmoc.navy.mil>

    Bonjour,

What does Andreas Rossberg in his SML vs. Caml page

    http://www.ps.uni-sb.de/~rossberg/SMLvsOcaml.html

mean when he says that

   [Caml] Does not have a proper generic equality
   on one hand (1, r) != (1, r), on the other (1, r) = (1, ref 1)


Is this the "problem" he is pointing  ?

# let r = ref 1 in (1, r) = (1, r);;
- : bool = true

# let r = ref 1 in (1, r) != (1, r);;
- : bool = true

As far as I understand the only dark corners with structural equality are
border cases (Nan) where compare differs from (=).

[from Pervasives.ml]
external (=) : 'a -> 'a -> bool = "%equal"
external (<>) : 'a -> 'a -> bool = "%notequal"
external compare: 'a -> 'a -> int = "%compare"

external (==) : 'a -> 'a -> bool = "%eq"
external (!=) : 'a -> 'a -> bool = "%noteq"

        Diego Olivier


  reply	other threads:[~2006-09-16 18:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-09  3:11 Comparing two things of any two types, in pure OCaml oleg
2006-09-09  7:13 ` [Caml-list] " Jacques Garrigue
2006-09-13  9:14   ` [Caml-list] Comparing two things of any two types, in pure oleg
2006-09-16 18:53     ` Diego Olivier Fernandez Pons [this message]
2006-09-16 20:58       ` [Caml-list] Improper generic equality in Caml (Rossberg's SML vs Caml) Jacques Garrigue
2006-09-17  5:08       ` rossberg
2006-09-17  9:45         ` skaller
2006-09-17 12:43           ` rossberg
2006-09-14  4:36   ` [Caml-list] Comparing two things of any two types, in pure OCaml brogoff

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=Pine.A41.4.44.0609162018590.1511520-100000@ibm1 \
    --to=diego.fernandez_pons@etu.upmc.fr \
    --cc=caml-list@inria.fr \
    --cc=diego-olivier.fernandez-pons@cicrp.jussieu.fr \
    --cc=rossberg@ps.uni-sb.de \
    /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).