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 TAA09905; Wed, 2 Jun 2004 19:41:04 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 TAA10432 for ; Wed, 2 Jun 2004 19:41:03 +0200 (MET DST) Received: from mailf0.uni-siegen.de (mailf0.Uni-Siegen.DE [141.99.11.40]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i52Hf2SH017205 for ; Wed, 2 Jun 2004 19:41:02 +0200 Received: from [141.99.131.109] ([141.99.131.109]) by mailf0.uni-siegen.de with Microsoft SMTPSVC(5.0.2195.6713); Wed, 2 Jun 2004 19:41:02 +0200 Mime-Version: 1.0 (Apple Message framework v618) In-Reply-To: <20040518085224.GA15477@redhat.com> References: <40A8A1F6.3090604@di.ubi.pt> <69392398-A827-11D8-89DA-0003939A19AA@fas.harvard.edu> <20040518085224.GA15477@redhat.com> Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: <03CA2ED3-B4BC-11D8-86A1-000A95C6FE96@mathematik.uni-siegen.de> Content-Transfer-Encoding: 7bit From: Holger Schulz Subject: Re: [Caml-list] Teaching OCaml Date: Wed, 2 Jun 2004 19:41:01 +0200 To: caml-list@inria.fr X-Mailer: Apple Mail (2.618) X-OriginalArrivalTime: 02 Jun 2004 17:41:02.0655 (UTC) FILETIME=[C60BFCF0:01C448C8] X-Miltered: at concorde with ID 40BE112E.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; schulz:99 schulz:99 caml-list:01 quicksort:01 haskell:01 quicksort:01 ocaml:01 ocaml:01 schrieb:01 syntax:02 o'caml:02 classic:03 algorithms:03 efficient:05 efficient:05 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Am 18.05.2004 um 10:52 schrieb Richard Jones: >> Iif you want practical features of OCaml, you could try the classic >> "QuickSort in n lines" where n depends on how efficient you want to >> make it, but you can still achieve O(n log n) in something like 4 >> lines. It takes 10 or so to be efficient, compared to at least 50 in >> C. Of course, Haskell has even nicer syntax for this, but it looks >> good in O'Caml too. > > Sorry, but why is this a "practical" feature of OCaml? I'm not quite sure if it is a practical feature but it is an important aspect on teaching programming to have code which is easy to survey. > Anyone who uses OCaml to sort things will use List.sort, unless they > have incredibly specialist sorting requirements, in which they > certainly won't be using a 4-line implementation of quicksort. Hm, learning algorithms includes implementimg them, even if that has been done before. By the way: are the 4 or 10 line source available online anywhere? I'd like to take a look at. ------------------- 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