From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by sympa.inria.fr (Postfix) with ESMTPS id 1CA327ED1A for ; Mon, 21 May 2012 16:49:14 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqAEAIlUuk9beTnJ/2dsb2JhbABEhS2vXIIVAQEFIw8BBUABEAkCDgoCAgUWCwICCQMCAQIBRQYNAQUCAogKBKw5klOBJolfBYQ0gRQDlRuBD4RAiiGCaw X-IronPort-AV: E=Sophos;i="4.75,631,1330902000"; d="scan'208";a="144514746" Received: from krypton.hackadomia.org (HELO dogguy.org) ([91.121.57.201]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 21 May 2012 16:49:13 +0200 Received: from [129.199.97.235] (dhcp235.dmi.ens.fr [129.199.97.235]) by dogguy.org (Postfix) with ESMTPSA id 14F06200F4; Mon, 21 May 2012 16:49:13 +0200 (CEST) Message-ID: <4FBA55BD.2070701@dogguy.org> Date: Mon, 21 May 2012 16:48:29 +0200 From: Mehdi Dogguy User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.4) Gecko/20120510 Icedove/10.0.4 MIME-Version: 1.0 To: Philippe Wang CC: Gerd Stolpmann , caml-list@inria.fr References: <20120521142336.79901oeoxunjuoc8.lealanko@webmail.helsinki.fi> <1337601452.19263.0@samsung> <1337607107.25112.77.camel@thinkpad> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Caml-list] Channels not closed on gc? On 21/05/12 16:18, Philippe Wang wrote: > On Mon, May 21, 2012 at 3:31 PM, Gerd > Stolpmann wrote: > >>> Wouldn't it be a good idea to provide both ways? i.e., one that >>> collects automatically, in addition to the current one that >>> doesn't. >> >> You can easily do this yourself: >> >> Gc.finalise close_in ch > > Certainly, but I meant on a high-level way, without the need to > explicitly use OCaml's internal API, for the sake of "non ocaml > hackers". :) > IIRC, OCaml core team has always been reluctant to add non-essential-to-the-compiler features/helpers in OCaml's stdlib. This proposal fits the "non-essential-to-the-compiler" description :) Besides, if I'm not mistaken, Batteries already provide such mechanism (See module BatIO). Some "non ocaml hackers" can already use it! Regards, -- Mehdi Dogguy مهدي الدڤي http://dogguy.org/