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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 9BAB3BC69 for ; Fri, 24 Aug 2007 04:55:00 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.234]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7O2sxZZ020813 for ; Fri, 24 Aug 2007 04:55:00 +0200 Received: by nz-out-0506.google.com with SMTP id z3so429987nzf for ; Thu, 23 Aug 2007 19:54:59 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=V8B7Wv3g7TDnZcstl6W0Z9rQx3GHgX5kIDdMCbnijq5RxI6bkAL2gh/UW6RRm6OgxHxbriMPs3G6s42ifRysQHGvP5WnWxtjWhWONkc/dXtgjRDOb6Y3uI9sAkCVwVkjvRm3eSJXbYtxygv3QeNitXKJzFTc64rnqf+/glHBHTI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hqIUCSLlrifr6NHikSsJmIrXY7Y0xuVEuy87LPa5+ZYOudO8oXgszMrTz79wsXxtql+hA4oekZfsjGoKwtgdiuStQXaVOkldBTgYbxex23jO/NLALuV+TZqYiKQO/vHaTEd1yyAKk+Z6Gk+5AvsllkvUBa4Hd374aaZ8dReGV+s= Received: by 10.142.142.16 with SMTP id p16mr296696wfd.1187924098369; Thu, 23 Aug 2007 19:54:58 -0700 (PDT) Received: by 10.142.80.9 with HTTP; Thu, 23 Aug 2007 19:54:58 -0700 (PDT) Message-ID: Date: Thu, 23 Aug 2007 19:54:58 -0700 From: "Nathaniel Gray" To: "Luca de Alfaro" Subject: Re: [Caml-list] If OCaml were a car Cc: "Erik de Castro Lopo" , "Caml-list List" In-Reply-To: <28fa90930708212250w15ce8fdai7fa615414d0279d@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20070818192157.GA11789@furbychan.cocan.org> <6806cf750708181324l724823c6w304f9088980c3316@mail.gmail.com> <46C76557.5050308@cs.caltech.edu> <56864F61-40F3-4F03-9823-6D510AD5320B@epfl.ch> <20070819215924.6234b446.mle+ocaml@mega-nerd.com> <28fa90930708212250w15ce8fdai7fa615414d0279d@mail.gmail.com> X-j-chkmail-Score: MSGID : 46CE4883.002 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 46CE4883.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 iter:01 iter:01 camlp:01 camlp:01 cheers:01 wrote:01 readable:01 caml-list:01 labels:03 everyday:96 library:03 let:03 luca:04 On 8/21/07, Luca de Alfaro wrote: > The only thing about Ocaml I mind, is that it a bit like German is, in that > all the verbs at the end come. And there nothing wrong is, but it for some > strange reading makes, and it strange is that this from France comes. > > I still somewhat puzzled am, at reading: > > let f x = > [humonguous definition 50 lines spanning] > in List.iter f l > > because the only way I make sense of this can, is by first looking at where > f used is, and only then reading its definition. > I much rather write would: > > do List.iter f l > where f x = [humonguous definition] Given the prevalence of List.fold and friends, I think this (the order of arguments) is the biggest obstacle to code comprehension in OCaml. I've even gone so far as to create my own ReList (readable list) library: ReList.iter l (fun x -> [humongous definition] ) As others have mentioned, labels can help as well if that's an option for you, but I find the label system to be a bit intrusive for everyday usage. > Maybe this problem with Ocamlp4 solvable is? I think it already has been done once or twice with camlp4. This and try/finally are popular in camlp4 demos... Cheers, -n8 -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu -->