From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id BC324BC6B for ; Thu, 10 Jan 2008 20:48:18 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAD8FhkfAXQImh2dsb2JhbACQHwEBAQgKKYEUmAM X-IronPort-AV: E=Sophos;i="4.24,267,1196636400"; d="scan'208";a="7655143" Received: from discorde.inria.fr ([192.93.2.38]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Jan 2008 20:48:18 +0100 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m0AJmFZ0011830 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 10 Jan 2008 20:48:18 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAM8EhkfAbSoIh2dsb2JhbACQHwEBAQgKKYEUmAA X-IronPort-AV: E=Sophos;i="4.24,267,1196636400"; d="scan'208";a="21106683" Received: from einhorn.in-berlin.de ([192.109.42.8]) by mail4-smtp-sop.national.inria.fr with ESMTP; 10 Jan 2008 20:48:17 +0100 X-Envelope-From: oliver@first.in-berlin.de X-Envelope-To: Received: from einhorn.in-berlin.de (localhost [127.0.0.1]) by einhorn.in-berlin.de (8.13.6/8.13.6/Debian-1) with ESMTP id m0AJmGOP029213 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 10 Jan 2008 20:48:16 +0100 Received: (from www-data@localhost) by einhorn.in-berlin.de (8.13.6/8.13.6/Submit) id m0AJmGVs029210 for caml-list@inria.fr; Thu, 10 Jan 2008 20:48:16 +0100 X-Authentication-Warning: einhorn.in-berlin.de: www-data set sender to oliver@first.in-berlin.de using -f Received: from dslb-088-073-077-156.pools.arcor-ip.net (dslb-088-073-077-156.pools.arcor-ip.net [88.73.77.156]) by webmail.in-berlin.de (IMP) with HTTP for ; Thu, 10 Jan 2008 20:48:16 +0100 Message-ID: <1199994496.4786768086a07@webmail.in-berlin.de> Date: Thu, 10 Jan 2008 20:48:16 +0100 From: Oliver Bandel To: Caml-list List Subject: Re: [Caml-list] Annoying behaviour of OCaml References: <4786312A.1050003@functionality.de> In-Reply-To: <4786312A.1050003@functionality.de> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.6 X-Scanned-By: MIMEDefang_at_IN-Berlin_e.V. on 192.109.42.8 X-Miltered: at discorde with ID 4786767F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; bandel:01 in-berlin:01 ocaml:01 haskell:01 hugs:01 haskell:01 hugs:01 ocaml:01 bool:01 oliver:01 oliver:01 abstract:01 caml-list:01 int:01 behaviour:01 Zitat von Thomas Fischbacher : [...] > > compare ((17,23),[|8;9;10|]) ((12,21),[|8;9|]);; 17 > 12 This must give back 1. > > (* This situation is quite similar to the one where encountered > the problem. We tried to use Array.sort in conjunction with > "compare" to sort some abstract specifications of contributions > to a sparse matrix of the form ((row,column),array_of_factors) > by row, assuming that "compare" would do the job through > lexicographical order, but actually, it does not. In this case, > the result is +1 rather than -1! > *) > > compare ((17,23),[8;9;10]) ((12,21),[8;9]);; 17 > 12 This must give back 1. > > Let us see for comparison how other H.M.-typed languages behave: > Haskell (hugs): > > Haskell 98 mode: Restart with command line option -98 to enable > extensions > > Type :? for help > Hugs.Base> ((17,23),[8,9,10]) < ((12,21),[8,9]) > False > Hugs.Base> # compare 1 2;; - : int = -1 Is -1 to be interpreted as false or as true? OCaml: # ((17,23),[8;9;10]) < ((12,21),[8;9]);; - : bool = false So it's the same as in Haskell. So it should be what you expected. Ciao, Oliver