From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p3E7X1n0000645 for ; Thu, 14 Apr 2011 09:33:02 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgQEAJKipk1KfVI0kGdsb2JhbACYTI0qCBQBAQEBCQkNBxQEIaVkimiCI4U1MIhdAQEDBoVoBI1vg3N8hGE6 X-IronPort-AV: E=Sophos;i="4.64,210,1301868000"; d="scan'208";a="80759873" Received: from mail-ww0-f52.google.com ([74.125.82.52]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 14 Apr 2011 09:32:30 +0200 Received: by wwe15 with SMTP id 15so2022540wwe.9 for ; Thu, 14 Apr 2011 00:32:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=hnFZ4wBuBO6NXqPVchswCxprmcOvS/OqH0did7/KVxA=; b=gIr/ZPlY4y+fXQZ0+b1F/d/4inqgThtSDVZBG9k85SqElULrFJoPrbKmcNrLx7qNLT 3ZEkYqsv2cs2v8haX9dfMFdtQkJOHMqzr44w6GXUQ2euA7/N5i9UEMEO15SGh7n4tb0i 4JwKdTUgP5HoiFBYz30kLcxwjQnnYjSwLrAX4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=sE1miwDFLhIaVdNlV+fmOlP4DJ9p9H8+SYdgitpt+oo6mmRCqVDTsjT0/bEPZPg/5G n+CDTqPwb17Ud7jF/hxHTT3GD2Y9ukyxvr9OpSctMJV6vGMBmt0obxmOj9fKvqBTzgrG Ew3iqpRRYnTIH1TkdZGxjbB6XAobwHidgIK7I= Received: by 10.227.7.18 with SMTP id b18mr446595wbb.103.1302766347338; Thu, 14 Apr 2011 00:32:27 -0700 (PDT) Received: from [192.168.1.20] (APuteaux-154-1-82-52.w83-204.abo.wanadoo.fr [83.204.161.52]) by mx.google.com with ESMTPS id w12sm800678wby.41.2011.04.14.00.32.24 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 14 Apr 2011 00:32:25 -0700 (PDT) Message-ID: <4DA6A308.4050500@gmail.com> Date: Thu, 14 Apr 2011 09:32:24 +0200 From: Denis Berthod User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.15) Gecko/20110303 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: caml-list@inria.fr References: <4DA60A48.8010404@users.sourceforge.net> In-Reply-To: <4DA60A48.8010404@users.sourceforge.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Nicely written Caml/OCaml code to read. Hi, Some years ago, when I was a student, I found the code of Gérôme Vouillon's LWT library enlightning (LWT is now part of the Ocsigen project). Even if a great part of the concepts are OCaml only I recall that there is a Fibonacci heap implementation that might be a good example of list manipulation. Cheers, Denis Le 13/04/2011 22:40, Create Software a écrit : > Hi all, > > I'll be taking exams at the end of the year (starting in a week, > actually), which include programming / informatics tests. The language > used in these exams is Caml Light (you guessed right: grandes écoles). > > I've done a lot of programming in previous years, but I didn't know > Caml/OCaml before high school -- I come from a mixed C++/C# world, > with drops of Python here and there. > > In developing my skill in other languages, I always found that reading > good code at some point was a great boost to the beauty and cleanness > of the programs I wrote. Usually, every language has it's own > conventions, best practices, and I think you can usually learn a lot > by reading well-written, nicely-crafted code. > > So here's my question: **which code would you recommend to read?** > > (As a side note, I'm not really interested (at least in the very short > term) in anything on the object-oriented side of the language, since > the notions used at the exam are limited to the elements available in > Caml Light.) > > I've tried batteries and Jane street core/ext-core libraries, but the > former has extremely few comments, and the latter is too widely > optimized to be enjoyable to read (Jane street's map function is 30 > lines long due to loop unrolling). > > Anything that deals with trees or finite state automata gets extra > brownie points =) (and +2 if Gabriel Scherer answers) > > Thanks for your help! > Clément. >