Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] beginner question about camlp4
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-01-23 (21:44)
From: Charles Martin <joelisp@y...>
Subject: Re: [Caml-list] beginner question about camlp4

>Are you sure that's right?  I think (f chan) executes before the call
>to protect, and you want protect to execute f:

That's my punishment for not cutting and pasting actual code :)

let with_input_file fname f =
  let chan = open_in fname in
  protect (fun () -> f chan) (fun () -> close_in chan)

Do You Yahoo!?
Get your free address at

Bug reports:  FAQ:
To unsubscribe, mail  Archives: