From: Elnatan Reisner <elnatan@cs.umd.edu>
To: Alain Frisch <alain@frisch.fr>
Cc: Caml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions
Date: Mon, 10 Aug 2009 09:22:19 -0400 [thread overview]
Message-ID: <1249910539.27080.10.camel@veruca.cs.umd.edu> (raw)
In-Reply-To: <4A7F1EEF.2050301@frisch.fr>
On Sun, 2009-08-09 at 21:09 +0200, Alain Frisch wrote:
> On 8/9/2009 8:56 PM, Elnatan Reisner wrote:
> > My other issue is that the description of (==) for mutable structures
> > doesn't specify that it is symmetric; reading the documentation
> > literally only implies that e1 is a substructure of e2. Even just adding
> > 'and vice versa' might clean this up:
> > |e1 == e2| is true if and only if physical modification of |e1| also
> > affects |e2 and vice versa|
>
> It depends on what 'physical modification' and 'affect' mean. Clearly,
> the documentation means toplevel modifications of the values (i.e.
> modifying fields for record values, or elements for arrays or strings).
> If one includes deep modifications, then your extended criterion does
> not work either (think about two mutually recursive records).
You're right; thanks for pointing this out. But what does this mean for
physical equality? What does it really mean? Does [e1 == e2] mean e1 and
e2 are the same entity in memory---i.e., they are equal as C pointers?
> Note that (=) sometimes terminates for cylic values.
>
> # type t = A of t | B of t;;
> type t = A of t | B of t
> # (let rec x = A x in x) = (let rec x = B x in x);;
> - : bool = false
Again, thanks for pointing this out. But can (=) ever evaluate to true
on cyclic structures?
-Elnatan
next prev parent reply other threads:[~2009-08-10 13:22 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 17:09 ivan chollet
2009-08-08 17:24 ` [Caml-list] " David Allsopp
2009-08-09 7:58 ` ivan chollet
2009-08-09 10:16 ` Michel Mauny
[not found] ` <001501ca18cc$d59a61a0$80cf24e0$@metastack.com>
2009-08-09 12:06 ` ivan chollet
2009-08-09 13:20 ` David Allsopp
2009-08-09 13:55 ` Alain Frisch
2009-08-09 14:13 ` ivan chollet
2009-08-09 18:56 ` Elnatan Reisner
2009-08-09 19:09 ` Alain Frisch
2009-08-10 13:22 ` Elnatan Reisner [this message]
2009-08-10 13:36 ` Martin Jambon
2009-08-10 14:26 ` Elnatan Reisner
2009-08-09 16:14 ` Goswin von Brederlow
2009-08-10 4:14 ` ivan chollet
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=1249910539.27080.10.camel@veruca.cs.umd.edu \
--to=elnatan@cs.umd.edu \
--cc=alain@frisch.fr \
--cc=caml-list@yquem.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