Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Kevin S. Millikin" <kmillikin@atcorp.com>
To: "'Basile STARYNKEVITCH'" <basile@starynkevitch.net>,
	"caml-list@inria.fr" <caml-list@inria.fr>
Subject: RE: [Caml-list] Semantics of physical equality
Date: Fri, 27 Feb 2004 17:16:06 -0600	[thread overview]
Message-ID: <01C3FD55.6370F320.kmillikin@atcorp.com> (raw)

On Friday, February 27, 2004 3:32 PM, Basile STARYNKEVITCH 
[SMTP:basile@starynkevitch.net] wrote:
    >> On Fri, Feb 27, 2004 at 02:29:50PM -0600, Kevin S. Millikin
    >> wrote:
    >>
    >> # V1(0) == V1(0);; - : bool = false
    >>
    >> V1's are different.  Is this guaranteed?

    >> What do you mean by guaranteed?

I mean ``guaranteed'' in the sense that separate calls to cons in 
Scheme
are guaranteed to produce objects that are distinct (according to eqv?
and eq?), or that a call to malloc in C is guaranteed to never return a
pointer that is the same as any other currently valid pointer in the
program (according to ==).

    >> Why would you want a guarantee that V1 0 is not physically equal
    >> to V1 0? I tend to think that making such an hypothesis is
    >> dangerous and wrong, even if the current implementation
    >> demonstrate it.

For the same reason that I occasionally rely on separate cons cells not
being eq? in Scheme ;).  In the current problem, it can save me a great
deal of effort involved in generating temporary identifiers that are
guaranteed to be unique, and in wrapping library data structures that I
am unwilling to change in order merely to tag them.

I realize that it would be dangerous and wrong to rely on them being ==
if the semantics of value constructors and == did not guarantee they
would be.  So I guess that's my question: "is it dangerous and wrong to
rely on separately constructed values being different according to 
==?".

-- Kevin

PS: Anyway, it looks like Michal Moskal has answered in the negative.
Neither behavior is guaranteed, which is an acceptable answer (though
not the one I was looking for).

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


             reply	other threads:[~2004-02-27 23:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-27 23:16 Kevin S. Millikin [this message]
2004-02-27 23:48 ` Michal Moskal
2004-02-28  6:28   ` [Caml-list] " Jed Davis
  -- strict thread matches above, loose matches on Subject: below --
2004-02-27 20:29 [Caml-list] " Kevin S. Millikin
2004-02-27 21:32 ` Basile STARYNKEVITCH
2004-02-27 22:59   ` Michal Moskal
2004-02-28  9:40     ` sejourne kevin
2004-02-28  9:55       ` Andreas Rossberg
2004-02-28 10:07         ` Michal Moskal
2004-02-28  9:56       ` Michal Moskal
2004-02-28 10:21         ` Andreas Rossberg
2004-02-28 10:34           ` Michal Moskal
2004-02-28 10:45             ` Andreas Rossberg
2004-02-28 11:25               ` Michal Moskal

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=01C3FD55.6370F320.kmillikin@atcorp.com \
    --to=kmillikin@atcorp.com \
    --cc=basile@starynkevitch.net \
    --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