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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE 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 1ED3EBC82 for ; Wed, 22 Aug 2007 11:21:21 +0200 (CEST) Received: from kurims.kurims.kyoto-u.ac.jp (kurims.kurims.kyoto-u.ac.jp [130.54.16.1]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l7M9LIgS016221 for ; Wed, 22 Aug 2007 11:21:20 +0200 Received: from localhost (orion [130.54.16.5]) by kurims.kurims.kyoto-u.ac.jp (8.13.8/8.13.8) with ESMTP id l7M9KxHF016992; Wed, 22 Aug 2007 18:20:59 +0900 (JST) Date: Wed, 22 Aug 2007 18:20:52 +0900 (JST) Message-Id: <20070822.182052.63049707.garrigue@math.nagoya-u.ac.jp> To: jon@ffconsultancy.com Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] If OCaml were a car From: Jacques Garrigue In-Reply-To: <200708220913.39184.jon@ffconsultancy.com> References: <20070819215924.6234b446.mle+ocaml@mega-nerd.com> <28fa90930708212250w15ce8fdai7fa615414d0279d@mail.gmail.com> <200708220913.39184.jon@ffconsultancy.com> X-Mailer: Mew version 4.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 46CC000F.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 iter:01 iter:01 stdlabels:01 wrote:01 caml-list:01 garrigue:03 garrigue:03 jacques:03 jacques:03 vanilla:03 let:03 let:03 luca:04 From: Jon Harrop > On Wednesday 22 August 2007 06:50:24 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] > > > > Maybe this problem with Ocamlp4 solvable is? > > Get this to good effect in vanilla OCaml by copying F# you can: > > let ( |> ) x f = f x > > l |> List.iter > (fun e -> ...) Or, sugar-free, open StdLabels List.iter l ~f: begin fun x -> ... end Jacques Garrigue