caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Revised syntax scope (3.10 vs. 3.11)
@ 2009-03-27  4:42 Andre Nathan
  2009-03-27  9:45 ` [Caml-list] " Nicolas Pouillard
  0 siblings, 1 reply; 3+ messages in thread
From: Andre Nathan @ 2009-03-27  4:42 UTC (permalink / raw)
  To: caml-list

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


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

end of thread, other threads:[~2009-03-27 14:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-27  4:42 Revised syntax scope (3.10 vs. 3.11) Andre Nathan
2009-03-27  9:45 ` [Caml-list] " Nicolas Pouillard
2009-03-27 14:43   ` Andre Nathan

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).