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 discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 4CD89BC68 for ; Wed, 25 Oct 2006 17:23:35 +0200 (CEST) Received: from mail.corp.idt.net (mail.corp.idt.net [169.132.25.53]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k9PFNYsB016909 for ; Wed, 25 Oct 2006 17:23:34 +0200 Received: from [169.132.9.113] (account saleyn HELO [169.132.9.113]) by mail.corp.idt.net (CommuniGate Pro SMTP 4.2.10) with ESMTP id 181993467 for caml-list@inria.fr; Wed, 25 Oct 2006 11:23:27 -0400 Message-ID: <453F816F.5080101@hq.idt.net> Date: Wed, 25 Oct 2006 11:23:27 -0400 From: Serge Aleynikov User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: caml-list@inria.fr Subject: camlp4 scope issue Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 453F8176.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; camlp:01 printf:01 compiler:01 printf:01 ocamlc:01 -pp:01 camlp:01 scope:03 scope:03 let:03 let:03 serge:04 serge:04 variable:06 apparently:07 Hi, In the test program below in my understanding the 'y' variable should be out of scope in the printf statement, but apparently it's not. The compiler version is 3.09.3. $ cat tst.ml value f z = z + 1; let x = 1 in do { let y = f x in (); Printf.printf "y should be out of scope, but it's not: y = %d\n" y }; $ ocamlc -o tst -pp camlp4r tst.ml $ ./tst y should be out of scope, but it's not: y = 2 Any idea why? -- Serge Aleynikov Routing R&D, IDT Telecom Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464