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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 7C0AABBAF for ; Fri, 27 Mar 2009 05:38:10 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtwDAI/0y0nIuX5CgWdsb2JhbACWAAEBFiK8QIN3Bg X-IronPort-AV: E=Sophos;i="4.38,430,1233529200"; d="scan'208";a="25073725" Received: from mta19.f3.k8.com.br ([200.185.126.66]) by mail3-smtp-sop.national.inria.fr with ESMTP; 27 Mar 2009 05:38:09 +0100 Received: from localhost (localhost [127.0.0.1]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id D9DD528000A2 for ; Fri, 27 Mar 2009 04:38:06 +0000 (GMT) X-Virus-Scanned: amavisd-new at k8.com.br Received: from smtpa.f3.k8.com.br ([127.0.0.1]) by localhost (mta19.f3.k8.com.br [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oYglD-Lcwljb for ; Fri, 27 Mar 2009 04:38:06 +0000 (GMT) Received: from [189.106.1.98] (unknown [189.106.1.98]) by smtpa.f3.k8.com.br (Postfix) with ESMTP id 8E8072800094 for ; Fri, 27 Mar 2009 04:38:05 +0000 (GMT) Subject: Revised syntax scope (3.10 vs. 3.11) From: Andre Nathan To: caml-list@inria.fr Content-Type: text/plain Date: Fri, 27 Mar 2009 01:42:34 -0300 Message-Id: <1238128954.6000.21.camel@homesick> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; syntax:01 ocaml:01 expr:01 foo:01 endline:01 endline:01 camlp:01 foo:01 nathan:98 revised:02 binding:02 let:03 let:03 scope:04 scope:04 Hello I've found the following difference of behavior between OCaml 3.10 and 3.11. The code below <:expr< do { let a = "foo" in print_endline a; print_endline a } >> when run through camlp4o becomes, in 3.10, let a = "foo" in (print_endline a; print_endline a) while in 3.11 it becomes ((let a = "foo" in print_endline a); print_endline a) which causes `a' to become out of scope in the second print_endline. Is the behavior of 3.11 the correct one? I had to move the binding of `a' out of the do block so that this works in both versions. Thanks, Andre