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.1 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id ACD06BB84 for ; Wed, 13 Aug 2008 12:50:00 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiADAARZokip5TxXiGdsb2JhbACRdgEBAQ8gnVeHBUCBVQ X-IronPort-AV: E=Sophos;i="4.32,201,1217800800"; d="scan'208";a="16081650" Received: from gateway0.eecs.berkeley.edu ([169.229.60.87]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 13 Aug 2008 12:49:59 +0200 Received: from [10.0.1.5] (136-152-208-53.VPN.Berkeley.EDU [136.152.208.53]) (authenticated bits=0) by gateway0.EECS.Berkeley.EDU (8.14.3/8.13.5) with ESMTP id m7DAnMVq028994 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 13 Aug 2008 03:49:23 -0700 (PDT) In-Reply-To: References: <9E2C98C8798A487DAE77F20A9DC4F1E8@countertenor> <7C6C7ADD-910D-4C62-92FF-E286F0817FA1@cs.berkeley.edu> Mime-Version: 1.0 (Apple Message framework v753.1) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <1C96BA4C-8E65-44AA-96CD-C1CA399635E2@cs.berkeley.edu> Cc: OCaml List Content-Transfer-Encoding: 7bit From: Brighten Godfrey Subject: Re: [Caml-list] Value shadowing (tangent) Date: Wed, 13 Aug 2008 03:49:23 -0700 To: David Allsopp X-Mailer: Apple Mail (2.753.1) X-Spam: no; 0.00; ocaml:01 wrote:01 readable:01 caml-list:01 let:03 let:03 berkeley:04 fun:08 fun:08 compact:09 actually:10 aug:10 lst:12 lst:12 sort:12 Going off on a tangent here... On Aug 13, 2008, at 2:56 AM, David Allsopp wrote: > > let lst = [5; 4; 3; 2; 1; 0; -1; -2; -3; -4; -5] > in > let filter = List.filter (fun x -> x > 0) > in > let double = List.map (fun x -> -2 * x) > in > let sort = List.sort compare > in > (sort $$ double $$ filter) lst I've seen little of other people's OCaml code, so out of curiosity, do you or others actually write code formatted like the above, as opposed to the more compact and (I think) readable let lst = [5; 4; 3; 2; 1; 0; -1; -2; -3; -4; -5] in let filter = List.filter (fun x -> x > 0) in let double = List.map (fun x -> -2 * x) in let sort = List.sort compare in (sort $$ double $$ filter) lst ? ~Brighten