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.4 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, DNS_FROM_SECURITYSAGE autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id BA24EBBAF for ; Sat, 25 Oct 2008 14:07:38 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHapAkmCNhAB/2dsb2JhbADBD4NP X-IronPort-AV: E=Sophos;i="4.33,483,1220220000"; d="scan'208";a="16483748" Received: from kurims.kurims.kyoto-u.ac.jp ([130.54.16.1]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 Oct 2008 14:07:22 +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 m9PC4iEc024877; Sat, 25 Oct 2008 21:04:44 +0900 (JST) Date: Sat, 25 Oct 2008 21:05:08 +0900 (JST) Message-Id: <20081025.210508.173546356.garrigue@math.nagoya-u.ac.jp> To: d@doomeer.com Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] What does Jane Street use/want for an IDE? What about you? From: Jacques Garrigue In-Reply-To: <4902F183.5060504@doomeer.com> References: <49008D7D.4060908@lri.fr> <490096B8.3020602@ramenlabs.com> <4902F183.5060504@doomeer.com> X-Mailer: Mew version 5.2 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; stdlabels:01 blabla:01 blabla:01 tuareg:01 beginner's:01 ocaml:01 bug:01 beginner's:01 ocaml:01 bug:01 beginners:01 beginners:01 wrote:01 readable:01 readable:01 Using labels makes this kind of code more readable. open StdLabels let x =3D List.map my_list ~f: begin fun z -> very_blabla end in ... Jacques Garrigue From: DooMeeR > Another possibility is: > = > let x =3D List.map begin fun z -> > very_blabla > end my_list in > = > It's quite compact, doesn't run into the margin, is consistent with = > tuareg, but might be less readable. > = > -- = > Romain Bardou > = > Dave Benjamin a =E9crit : > > Romain Bardou wrote: > >> let x =3D List.map (fun z -> > >> very_long_stuff_blablablablablablablabla) > > > > I tend to write this sort of thing as: > > > > let x =3D > > List.map > > (fun z -> > > very_long_stuff_blablablablablablablabla) > > ... > > > > which, as you may notice, still can't be done with tabs alone due t= o = > > the extra space after the opening parenthesis. I'm curious what you= = > > all think of this coding style, which seems on one hand to be = > > excessively... um, vertical? but it does seem to strike a balance = > > between Tuareg's indentation rules and the problem of "running into= = > > the margin" too quickly. > > > > BTW, If you keep the function on the first line, it's a bit more = > > compact, but the indentation no longer tells the truth about the re= al = > > hierarchy: > > > > let x =3D List.map > > (fun z -> > > very_long_stuff_blablablablablablablabla) > > ... > > > > This is why I tend to put the function on a line of its own as soon= as = > > things start to wrap. > > > > Dave > > > > _______________________________________________ > > Caml-list mailing list. Subscription management: > > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > > Archives: http://caml.inria.fr > > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > > Bug reports: http://caml.inria.fr/bin/caml-bugs > = > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs