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 QAA13037; Fri, 2 Nov 2001 16:06:26 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA13005 for ; Fri, 2 Nov 2001 16:06:25 +0100 (MET) Received: from smtp2.cswv.com (smtp2.cswv.com [4.17.129.20]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id fA2F6OX22610 for ; Fri, 2 Nov 2001 16:06:24 +0100 (MET) Received: from smtp2.cswv.com ([10.2.3.6]) by smtp2.cswv.com with Microsoft SMTPSVC(5.5.1877.197.19); Fri, 2 Nov 2001 10:06:17 -0500 Received: FROM exchange1.cswv.com BY smtp2.cswv.com ; Fri Nov 02 10:06:17 2001 -0500 Received: by exchange1.cswv.com with Internet Mail Service (5.5.2653.19) id ; Fri, 2 Nov 2001 10:10:20 -0500 Message-ID: From: "Krishnaswami, Neel" To: "'Marcin 'Qrczak' Kowalczyk'" , caml-list@inria.fr Subject: Re: [Caml-list] Sorting Date: Fri, 2 Nov 2001 10:10:19 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Marcin 'Qrczak' Kowalczyk [mailto:qrczak@knm.org.pl] wrote: > > What are advantages and disadvantages in parametrizing either by '<' > or by the 3-way comparison? If comparisons are very expensive -- for instance, if the elements are long strings or large sets -- then it makes for faster execution to use a three-way comparison. On the average you will do two-thirds as many comparisons while sorting with a three-way comparison. I find this irritating becuase it just *feels* nicer to pass a function of type elt -> elt -> bool to a sorting function. It's closer to how sorting is taught, and hence to my mental model. :) -- Neel Krishnaswami neelk@cswcasa.com ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr