From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 5F12CBC57 for ; Thu, 27 May 2010 18:01:32 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AsECAKMz/kvRVaA0kGdsb2JhbACeFwgVAQEBAQkJDAcRAx+xO4IBhV4uiE8BAQMFhQ4Eg0I X-IronPort-AV: E=Sophos;i="4.53,312,1272837600"; d="scan'208";a="60151946" Received: from mail-pw0-f52.google.com ([209.85.160.52]) by mail1-smtp-roc.national.inria.fr with ESMTP; 27 May 2010 18:01:31 +0200 Received: by pwi10 with SMTP id 10so89962pwi.39 for ; Thu, 27 May 2010 09:01:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=1eO/qRi6QEAuF7DwCZfGaq9WdhgyoTZZlcHlGFoEf/8=; b=WRPoksWd6RFjaZbTVpsJhpYuTt5iZlvJhDjkSdv6tsOkb0CZ8nyBrdsPDGV6RXJnAs 7/wKirXGGwG98bVzvBccM1bg9/tHwF8pN51ADWF0sJdO+WDRXnlcnLeqx31PoVnCmTJY WX43rF2Y/i/ijTobsydXvvhIb1H8cXy0pIPJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=KjwwCeJvVJYGoFo32bmvmEBdLw1hwBXjX/ln92Lz8Lr0aKbOtdc3whxwoPZRQczLbM jUCYQZl7pTOxeKXSaiqfcybRtukbKaOdkJlqonseUluG32UwXOGS6HMd/iiWPrRea8QX x1IXURUIzNXdFhxwWoUAT3ilSfKTN5vnL57N8= Received: by 10.115.39.17 with SMTP id r17mr9219801waj.40.1274976089817; Thu, 27 May 2010 09:01:29 -0700 (PDT) Received: from [192.168.2.2] ([71.135.104.167]) by mx.google.com with ESMTPS id n32sm11142307wae.22.2010.05.27.09.01.27 (version=SSLv3 cipher=RC4-MD5); Thu, 27 May 2010 09:01:28 -0700 (PDT) Message-ID: <4BFE9756.7010401@gmail.com> Date: Thu, 27 May 2010 09:01:26 -0700 From: Edgar Friendly User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10pre) Gecko/20100407 Shredder/3.0.5pre MIME-Version: 1.0 To: david.baelde@ens-lyon.org, caml-list@yquem.inria.fr Subject: Re: [Caml-list] New emacs tuareg mode References: <4BFB2148.5060603@colba.net> <20100526.163107.618177699151860158.Christophe.Troestler+ocaml@umons.ac.be> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; emacs:01 tuareg:01 syntax:01 semantics:01 improper:01 edgar:98 wrote:01 caml-list:01 expression:02 parse:02 namely:02 let:03 let:03 indentation:04 clarify:04 On 05/27/2010 02:46 AM, David Baelde wrote: > For example: > > if blah then > let () = f () in > g () ; > h () > > is not the same as > > if blah then > f () ; > g () ; > h () > > This difference is only because of (what I perceive as) flaws in the [if]/[then] syntax. Namely that semicolon-delimited chains of expressions don't parse within the [then] or [else] sections without extra bracketing. This lets adding a bit of debug code (in if/then - exactly where it's usually needed) to totally break the semantics by pushing code outside the if/then expression. With improper indentation (like your second example), one can make it look like one thing is happening while another will happen. Your first code block is a good example of non indented [let] blocks looking good. Your second example should be indented as follows to clarify its actual structure: if blah then f () ; g () ; h () E