caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Olivier Andrieu <andrieu@oxygene.ijm.jussieu.fr>
To: Alan Schmitt <alan.schmitt@inria.fr>
Cc: caml-list@inria.fr,
	Juergen Pfitzenmaier <pfitzen@informatik.uni-tuebingen.de>
Subject: Re: [Caml-list] Comparison of functional values
Date: Wed, 7 Mar 2001 09:49:50 +0100	[thread overview]
Message-ID: <15013.63022.363394.271012@akasha.ijm.jussieu.fr> (raw)
In-Reply-To: <20010307062028.O7121@alan-schm1p.inria.fr>

 Alan Schmitt [Wednesday 7 March 2001] :
 > As stated in http://caml.inria.fr/ocaml/htmlman/manual031.html, != is
 > the negation of ==.

Salut Alan !

I known. But to use the Set functor, you need a `compare' function of
type ('a -> 'a -> int) whereas != and == have type ('a -> bool). 
So != does not seem very helpful here.

What I meant actually, was a «physical compare». I found out that 
this (crude) C function works :

value phys_comp(value a, value b)
{
 if(a<b)
   return Val_int(-1) ;
 else if(a>b)
   return Val_int(+1) ;
 else 
   return Val_int(0);
}

Olivier
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-03-07  8:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-06 21:51 Olivier Andrieu
2001-03-07  5:20 ` Alan Schmitt
2001-03-06 22:08   ` Juergen Pfitzenmaier
2001-03-07  8:49     ` Olivier Andrieu [this message]
2001-03-07  8:56       ` [Caml-list] Comparison of functional values Xavier Leroy
2001-03-06 22:17 Arturo Borquez

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=15013.63022.363394.271012@akasha.ijm.jussieu.fr \
    --to=andrieu@oxygene.ijm.jussieu.fr \
    --cc=alan.schmitt@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=pfitzen@informatik.uni-tuebingen.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).