caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* camlp4 scope issue
@ 2006-10-25 15:36 Serge Aleynikov
  2006-10-25 19:42 ` [Caml-list] " Dmitri Boulytchev
  0 siblings, 1 reply; 7+ messages in thread
From: Serge Aleynikov @ 2006-10-25 15:36 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-10-25 16:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-25 15:36 camlp4 scope issue Serge Aleynikov
2006-10-25 19:42 ` [Caml-list] " Dmitri Boulytchev
2006-10-25 16:04   ` Serge Aleynikov
2006-10-25 16:17     ` Nicolas Pouillard
2006-10-25 16:35       ` Serge Aleynikov
2006-10-25 20:19     ` Dmitri Boulytchev
2006-10-25 16:21       ` Mike Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).