Version française
Home     About     Download     Resources     Contact us    
Browse thread
try .. finally using new camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: tab@s...
Subject: Re: [Caml-list] try .. finally using new camlp4
On Mon, Jul 09, 2007 at 10:43:04AM +0100, Jeremy Yallop wrote:
> Jon's version avoids name capture.  If the user writes
> 
>    let r = 1 in
>      try
>        2
>      finally
>        print_endline (string_of_int r)
> 
> then your version (modulo the unit arguments) expands into
> 
>    let r = 1 in
>       let r = try 2
>               with e ->
>                  print_endline (string_of_int r);
>                  raise e in
>            print_endline (string_of_int r);
>            r
> 
> which prints "2" instead of "1".

indeed,
Thanks,
-- 
Vincent Hanquez