English version
Accueil     Ŕ propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis ŕ jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml ŕ l'adresse ocaml.org.

Browse thread
[Caml-list] equality over functional value
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2001-04-21 (17:04)
From: qrczak@k...
Subject: Re: [Caml-list] equality over functional value
Fri, 20 Apr 2001 23:23:26 +0200 (MET DST), Alain Frisch <frisch@clipper.ens.fr> pisze:

> While we are about it, what is the reason for disallowing structural
> comparison over functional values  (that is, comparing for instance the
> code address, then the environment) ?

It would say that (fun x -> x+1) is not equal to (fun x -> x+1).
Or maybe that it is, depending on how smart the compiler is.

And it's impossible to say whether (fun () -> 1+2) is equal to
(fun () -> 2+1).

Embedding pointer equality of immutable values into value equality
doesn't have a sane meaning.

 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
  ^^                      SYGNATURA ZASTĘPCZA

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