caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] equality over functional value
@ 2001-04-20 20:12 Georges Brun-Cottan
  2001-04-20 21:23 ` Alain Frisch
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Georges Brun-Cottan @ 2001-04-20 20:12 UTC (permalink / raw)
  To: caml-list


Hi, 

A friend of mine is just starting with ocaml. He was puzzled by the
following result:

# let a i = i;;
val a : 'a -> 'a = <fun>
# let b i = i;;
val b : 'a -> 'a = <fun>
# a=b;;
Uncaught exception: Invalid_argument "equal: functional value".
# a=a;;
- : bool = true
# 

That is 'a=a' does not return the expected exception.  Actually it
first hit this "curiosity" when creating a polymorphic 'sort' function
on lists - and by applying it to a [sort;sort..] list. It worked.

Is this a bug? 

It might means that some errors can came up detected later than any
Camel rider would have expected...


[Francais]

Bonjour, 

Un ami débute en ocaml. Il fut intrigué par le résultat suivant:

# let a i = i;;
val a : 'a -> 'a = <fun>
# let b i = i;;
val b : 'a -> 'a = <fun>
# a=b;;
Uncaught exception: Invalid_argument "equal: functional value".
# a=a;;
- : bool = true
# 

a=a ne retourne pas l'exception attendue. 

Est-ce un bogue? 

Je suis un peu inquiet à l'idée que certaines erreurs de programmation
grossière peuvent être ainsi être détectés trop tardivement.

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


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

end of thread, other threads:[~2001-04-24  7:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-04-20 20:12 [Caml-list] equality over functional value Georges Brun-Cottan
2001-04-20 21:23 ` Alain Frisch
2001-04-21 11:32   ` Marcin 'Qrczak' Kowalczyk
2001-04-21 15:24 ` David Monniaux
2001-04-23  7:01 ` Jean-Christophe Filliatre
2001-04-23  7:56 ` Xavier Leroy
2001-04-23 14:04   ` Alain Frisch
2001-04-24  7:13   ` Fabrice Le Fessant

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