News for hackers. Stuff that matters.
Re:Why We Use OCaml by edwintorok on Wednesday July 16, 2014 @03:58PM (#8044163)
You can also wrap the call-closure with an exception handler to make sure that 'f' is always closed when you leave with-open-file-for-writing.
Re:Why We Use OCaml by zem on Wednesday July 16, 2014 @04:01PM (#8044180)
right. and the beautiful thing is that once you realise that you only need to do it once, not everywhere you open, write to, and close a file.