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 KAA13412; Fri, 31 Jan 2003 10:35:52 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA13406 for caml-list@pauillac.inria.fr; Fri, 31 Jan 2003 10:35:52 +0100 (MET) 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 LAA20366 for ; Thu, 30 Jan 2003 11:02:54 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h0UA2rr16979 for ; Thu, 30 Jan 2003 11:02:53 +0100 (MET) Received: (from fpottier@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA20352 for caml-list@inria.fr; Thu, 30 Jan 2003 11:02:53 +0100 (MET) Date: Thu, 30 Jan 2003 11:02:53 +0100 From: Francois Pottier To: caml-list@inria.fr Subject: [Caml-list] Re: Lexicographic sort Message-ID: <20030130110253.A20483@pauillac.inria.fr> Reply-To: Francois.Pottier@inria.fr References: <20030130110049.A19993@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0i In-Reply-To: <20030130110049.A19993@pauillac.inria.fr>; from francois.pottier@inria.fr on Thu, Jan 30, 2003 at 11:00:49AM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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