caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Destructive use of file descriptors
@ 2015-08-06  9:40 Goswin von Brederlow
  2015-08-06  9:48 ` Nicolas Ojeda Bar
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Goswin von Brederlow @ 2015-08-06  9:40 UTC (permalink / raw)
  To: caml-list

Hi,

in Python one can write:

    with open("foo") as fd:
        fd.write(str)

This involves some language magic that will open the file for the
duration of the block and close it at the end. The file descriptor is
automatically closed at a know time and not leaked or left until the
GC gets around to cleaning it up.

Has anyone constructed something like that for ocaml? Maybe with a ppx
extension?

MfG
	Goswin

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

end of thread, other threads:[~2015-08-11 11:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06  9:40 [Caml-list] Destructive use of file descriptors Goswin von Brederlow
2015-08-06  9:48 ` Nicolas Ojeda Bar
2015-08-06 19:50   ` Malcolm Matalka
2015-08-11  9:36     ` Goswin von Brederlow
2015-08-11 11:14       ` Gabriel Scherer
2015-08-11 11:32         ` Ben Millwood
2015-08-06  9:48 ` Gabriel Scherer
2015-08-06  9:49 ` Pierrick Couderc

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