[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Popularity contest
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 27 Sep 2011 11:08:45 +0200
On Mon, Sep 26, 2011 at 9:06 AM, steve donovan
> local f = open_connection()
Any feelings/opinions about finalizers? My feeling is that it could be
done fairly efficiently, although of course the devil is in the
details: the guiding principle is "don't pay for what you don't use".
This can already be done with pcall all over the place, but it's messy
(and inefficient to create all those closures).
What it does provide is support for RAII and thus guarantees that
resources will be properly closed under all circumstances. For
instance, if you allocated a big temporary object then you do not have
to wait for the next GC cycle to have its memory reclaimed.
It's not the only finalization proposal, see