caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe DEHLINGER <christophe.dehlinger@ifp.fr>
To: Andreas Rossberg <AndreasRossberg@web.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] type of ==
Date: Mon, 18 Apr 2005 15:10:26 +0200	[thread overview]
Message-ID: <4263B1C2.3020109@ifp.fr> (raw)
In-Reply-To: <001901c5440f$ce1a5e80$14b2a8c0@wiko>

Andreas Rossberg wrote:

>The latter also provides a good argument against making physical equality
>too polymorphic. It would break abstraction, much worse than it does
>already. In particular, a program's meaning could depend on implementation
>details (like false being represented by 0) in very questionable ways.
>  
>
It's arguable that it wouldn't be /that/ much worse than the current 
situation, where == on non-mutable structures is already implementation 
dependent.
I am not advocating for such a change though, if only because in most 
cases the arguments of == are known to be of the same type, so it is a 
good thing to be able to take advantage of this information. However, it 
would still be nice to have both equalities available (yes, I know, yet 
another equality). In the problem I'm working on, only mutable 
structures are compared, so the extended == would work as intended. Of 
course, you would have to know what you're doing when using this 
predicate, but this is already the case for the current two equalities : 
you have to watch out for the aforementioned non-mutable structures with 
== and for cyclic values with = .

Call me pessimistic, but I have little hope that this "feature wish" 
will be fulfilled, so I would happily settle for fun a b -> a == 
(Obj.magic b) (if it works, still haven't had a chance to try it). I'd 
be grateful if someone could tell me whether this particular use of 
Obj.magic is safe.

Christophe


__________________________

Ce message (et toutes ses pièces jointes éventuelles) est confidentiel et établi à l'intention exclusive de ses destinataires. Toute utilisation de ce message non conforme à sa destination, toute diffusion ou toute publication, totale ou partielle, est interdite, sauf autorisation expresse. L'IFP décline toute responsabilité au titre de ce message.

This message and any attachments (the message) are confidential and intended solely for the addressees. Any unauthorised use or dissemination is prohibited. IFP should not be liable for this message.

Visitez notre site Web / Visit our web site : http://www.ifp.fr
__________________________





  reply	other threads:[~2005-04-18 13:11 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-18  9:18 Christophe DEHLINGER
2005-04-18 11:27 ` [Caml-list] " Jon Harrop
2005-04-18 12:11   ` Andreas Rossberg
2005-04-18 13:10     ` Christophe DEHLINGER [this message]
2005-04-18 14:28     ` Jon Harrop
2005-04-19  7:12       ` [Caml-list] type of == - Bayesian Filter detected spam Christophe DEHLINGER
2005-04-18 16:16   ` [Caml-list] type of == Remi Vanicat
2008-01-05 16:41 Type_of? Dario Teixeira
2008-01-05 17:12 ` [Caml-list] Type_of? Jeremy Yallop
2008-01-05 17:43 ` Arnaud Spiwack

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=4263B1C2.3020109@ifp.fr \
    --to=christophe.dehlinger@ifp.fr \
    --cc=AndreasRossberg@web.de \
    --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;
as well as URLs for NNTP newsgroup(s).