Version franēaise
Home     About     Download     Resources     Contact us    
Browse thread
Annoying behaviour of OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Eric Cooper <ecc@c...>
Subject: Re: [Caml-list] Annoying behaviour of OCaml
On Thu, Jan 10, 2008 at 02:52:26PM +0000, Thomas Fischbacher wrote:
> compare [|1;2;3|] [|4;5|];; (* ...but actially is not: this gives 1,
> 			       supposedly because the second list is
> 			       shorter than the first.
> 			    *)

This is indeed unexpected behavior:
    # compare "123" "45";;
    - : int = -1
    # compare [1;2;3] [4;5];;    
    - : int = -1
    # compare [|1;2;3|] [|4;5|];;
    - : int = 1

-- 
Eric Cooper             e c c @ c m u . e d u