From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id AFA67BB84 for ; Sun, 29 Jun 2008 18:30:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAN5VZ0jOe3NG/2dsb2JhbACuSw X-IronPort-AV: E=Sophos;i="4.27,722,1204498800"; d="scan'208";a="26834423" Received: from spoomusic.com ([206.123.115.70]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 29 Jun 2008 18:30:12 +0200 Received: (qmail 16614 invoked by uid 89); 29 Jun 2008 16:30:09 -0000 Received: from unknown (HELO ?192.168.1.99?) (98.165.129.233) by 0 with ESMTPS (DHE-RSA-AES256-SHA encrypted); 29 Jun 2008 16:30:09 -0000 Message-ID: <4867B896.2040506@ramenlabs.com> Date: Sun, 29 Jun 2008 09:30:14 -0700 From: Dave Benjamin User-Agent: Mozilla-Thunderbird 2.0.0.12 (X11/20080420) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: OCaml PLEAC reaches 70% Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; ocaml:01 ocaml:01 pervasives:01 non-blocking:01 linux's:01 snippets:01 steadily:98 sourceforge:01 sourceforge:01 unix:01 parsing:01 tail:01 benjamin:01 70%:98 corrections:01 Hello, The PLEAC project aims to translate the source code examples of the Perl Cookbook to many programming languages. I have been working steadily for the past two years toward completing the OCaml translation. As of today, it is 70.71% complete, in between Ruby (64.43%) and Python (85.43%). http://pleac.sourceforge.net/ http://pleac.sourceforge.net/pleac_ocaml/index.html Much of my recent work has been on the file I/O chapters, which cover the topics of reading and writing to files using Pervasives and the Unix module. The file access chapter covers argument parsing, file locking, buffering and non-blocking I/O: http://pleac.sourceforge.net/pleac_ocaml/fileaccess.html The file contents chapter contains some helpful examples of working with Streams and Buffers, line-indexing of large files, and manipulation of binary data including an example of using Richard Jones' Bitmatch library to parse and "tail" Linux's binary "utmp" database of login events: http://pleac.sourceforge.net/pleac_ocaml/filecontents.html I have updated the PDF version as well, if you prefer to read PLEAC in an offline format. You can download it here: http://ramenlabs.com/pleac-pdf/pleac_ocaml.pdf As always, feedback, corrections, and contributions are more than welcome, and I will do my best to make suggested improvements. I think that, despite being somewhat Perl-centric and in need of more explanation, the OCaml PLEAC has already become a valuable resource. I refer to it frequently myself. Hopefully some day there will be a real OCaml Cookbook. In the meantime, there are a lot of practical code snippets that can save a few trips to the manual / interface files. I hope you find it useful as well. Thanks, Dave