Proposal: Automatic Resource Management

Bob Lee crazybob at crazybob.org
Tue Mar 3 20:32:51 PST 2009


Neal, it might help if you cited some specific examples. I've never
personally suffered from Closeable's exception signature, and I can't
imagine suffering from that of Disposable. I have suffered from the fact
that no one seems to close resources correctly, and I'd love to have this
feature whether we get closures one day or not.

Bob

On Tue, Mar 3, 2009 at 8:19 PM, Neal Gafter <neal at gafter.com> wrote:

> I think you're missing the point, Josh.  People do this today with
> Closeable, because that's the closest interface available that could
> be used to perform this function, but clients suffer from its
> exception signature.  Disposable is better in one way - it would be
> retrofitted onto more classes - but much worse in its exception
> signature.  You're saying that there's no pain because you can't use
> it as a parameter type.  I'm saying that is the cause of the pain.
> The language construct that you're proposing does not supplant this
> technique of resource management, but the APIs you're proposing to go
> with it interfere with the technique.
>



More information about the coin-dev mailing list