Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Serge Aleynikov <serge@hq.idt.net>
To: caml-list@inria.fr
Subject: camlp4 scope issue
Date: Wed, 25 Oct 2006 11:23:27 -0400	[thread overview]
Message-ID: <453F816F.5080101@hq.idt.net> (raw)

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


             reply	other threads:[~2006-10-25 15:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25 15:23 Serge Aleynikov [this message]
2006-10-25 15:36 Serge Aleynikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=453F816F.5080101@hq.idt.net \
    --to=serge@hq.idt.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox