From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id WAA11140; Fri, 20 Apr 2001 22:12:17 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA11182 for ; Fri, 20 Apr 2001 22:12:16 +0200 (MET DST) Received: from emc.com (emcmail.lss.emc.com [168.159.48.78]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3KKCE529553 for ; Fri, 20 Apr 2001 22:12:15 +0200 (MET DST) Received: from lub0127.lss.emc.com (lub0127 [168.159.38.127]) by emc.com (8.10.1/8.10.1) with ESMTP id f3KKCET24251 for ; Fri, 20 Apr 2001 16:12:14 -0400 (EDT) Received: (from gbruncot@localhost) by lub0127.lss.emc.com (8.9.3/8.9.3) id QAA09326; Fri, 20 Apr 2001 16:12:14 -0400 (EDT) Date: Fri, 20 Apr 2001 16:12:14 -0400 (EDT) Message-Id: <200104202012.QAA09326@lub0127.lss.emc.com> X-Authentication-Warning: lub0127.lss.emc.com: gbruncot set sender to gbruncot@emc.com using -f From: Georges Brun-Cottan To: caml-list@inria.fr Subject: [Caml-list] equality over functional value MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=iso-8859-1 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 = # let b i = i;; val b : 'a -> 'a = # 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 = # let b i = i;; val b : 'a -> 'a = # 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