Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Lexicographic sort
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Pottier <francois.pottier@i...>
Subject: [Caml-list] Re: Lexicographic sort
On Thu, Jan 30, 2003 at 11:00:49AM +0100, Francois Pottier wrote:
> 
> For instance, here is code that sorts integer triples:
> 
>   let compare (major1, middle1, minor1) (major2, middle2, minor2) =
>     match major1 - major2, middle1 - middle2, minor1 - minor2 with
>     | 0, 0, d
>     | 0, d, _
>     | d, _, _ ->
> 	d

Of course, I should have said: here is code that *compares*
integer triples.

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners