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 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id E8B68BBAF for ; Sun, 17 Aug 2008 10:24:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8BAP58p0jC2fJXomdsb2JhbACJN4hUAQEBAQEBBQcGCRGfJYFY X-IronPort-AV: E=Sophos;i="4.32,223,1217800800"; d="scan'208";a="16044043" Received: from anchor-post-37.mail.demon.net ([194.217.242.87]) by mail3-smtp-sop.national.inria.fr with ESMTP; 17 Aug 2008 10:24:24 +0200 Received: from orion.metastack.com ([80.177.38.218]) by anchor-post-37.mail.demon.net with esmtp (Exim 4.69) id 1KUdYl-0004eN-Oq for caml-list@yquem.inria.fr; Sun, 17 Aug 2008 08:24:23 +0000 Received: from orion.metastack.com (IDENT:25@localhost [127.0.0.1]) by orion.metastack.com (8.13.4/8.13.3) with ESMTP id m7H84OAt029541 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 17 Aug 2008 09:05:02 +0100 Received: (from defang@localhost) by orion.metastack.com (8.13.4/8.13.3/Submit) id m7H7m1vr029501 for ; Sun, 17 Aug 2008 08:48:01 +0100 X-Authentication-Warning: orion.metastack.com: defang set sender to using -f Received: from countertenor (cpc1-cmbg10-0-0-cust76.cmbg.cable.ntl.com [81.102.132.77]) by orion.metastack.com (envelope-sender ) (MIMEDefang) with ESMTP id m7H7m1up029499; Sun, 17 Aug 2008 08:48:01 +0100 (BST) From: "David Allsopp" To: "=?iso-8859-1?Q?'Pierre_Etchema=EFt=E9'?=" , References: <9E2C98C8798A487DAE77F20A9DC4F1E8@countertenor><7C6C7ADD-910D-4C62-92FF-E286F0817FA1@cs.berkeley.edu><1C96BA4C-8E65-44AA-96CD-C1CA399635E2@cs.berkeley.edu><20080813110546.GA22672@snarc.org> <20080816220258.51bb5a5c@polo.concept-micro.com> Subject: RE: [Caml-list] Value shadowing (tangent) Date: Sun, 17 Aug 2008 09:07:10 +0100 Organization: MetaStack Solutions Ltd. Message-ID: <7BAD42D8D71E49F4BD1BB651ACBEC138@countertenor> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Acj/2JBb8wH1FOZSQPuMtG46PYuoyQAA+yuw In-Reply-To: <20080816220258.51bb5a5c@polo.concept-micro.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-Scanned-By: MIMEDefang 2.63 on 80.177.38.218 X-Spam: no; 0.00; 'let':01 initialise:01 non-trivial:01 caml-list:01 functions:01 latter:03 let:03 let:03 indentation:04 scope:04 scope:04 nested:04 depends:04 distinguish:05 style:93 > > however i understand why some people do it the first way. after the "in" > > you're in some sort of new scope (previous scope augmented by your > > let binds) > > On the other hand, the 'let' scope will end exactly at the same place as > the englobing scope. Since you can't close one without closing the > other, That's not true. let x = let y = let z = () in () in () (* z no longer in scope *) and a = () in (* y and z no longer in scope *) > it doesn't make a lot of sense (both practically and mentally) to > distinguish them, thru indentation of otherwise. Depends on whether you like to initialise non-trivial values with separate one-off functions or with nested lets. Personally, I prefer the latter but that's a matter of style/taste, not sense. David