caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Comparison of functional values
@ 2001-03-06 21:51 Olivier Andrieu
  2001-03-07  5:20 ` Alan Schmitt
  0 siblings, 1 reply; 6+ messages in thread
From: Olivier Andrieu @ 2001-03-06 21:51 UTC (permalink / raw)
  To: caml-list


Hello list, 

I wanted to build a Set of functional value. But generic equality
can't be used for functional values (raises an exception ...). It is
therefore difficult to build a Set of such values because the Set.Make
functor requires a comparison function and Pervasives.compare relies
on (=).

Is there a way around this ? I thought I could use physical equality
(wich is OK wrt functional values) but there's no such thing as
`physical inequality'.

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


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [Caml-list] Comparison of functional values
@ 2001-03-06 22:17 Arturo Borquez
  0 siblings, 0 replies; 6+ messages in thread
From: Arturo Borquez @ 2001-03-06 22:17 UTC (permalink / raw)
  To: andrieu; +Cc: caml-list

On Tue, 06 March 2001, Olivier Andrieu wrote:

> 
> 
> Hello list, 
> 
> I wanted to build a Set of functional value. But generic equality
> can't be used for functional values (raises an exception ...). It is
> therefore difficult to build a Set of such values because the Set.Make
> functor requires a comparison function and Pervasives.compare relies
> on (=).
> 
> Is there a way around this ? I thought I could use physical equality
> (wich is OK wrt functional values) but there's no such thing as
> `physical inequality'.
> 
> -- 
> Olivier Andrieu
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr

Hi Olivier:
Perhaps this help

let a = fun f x -> x = x;;
let b = fun f x -> x = x;;
(a == b) = true;;
-: bool = false
not (a == b) = true;;
-: bool = true

Regards
Arturo Borquez


Find the best deals on the web at AltaVista Shopping!
http://www.shopping.altavista.com
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2001-03-07  8:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-06 21:51 [Caml-list] Comparison of functional values Olivier Andrieu
2001-03-07  5:20 ` Alan Schmitt
2001-03-06 22:08   ` Juergen Pfitzenmaier
2001-03-07  8:49     ` [Caml-list] Comparison of functional values Olivier Andrieu
2001-03-07  8:56       ` Xavier Leroy
2001-03-06 22:17 Arturo Borquez

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).