Immediate closing of iterators

P T Withington ptw at pobox.com
Thu Jan 4 03:46:18 PST 2007


On 2007-01-02, at 15:30 EST, Brendan Eich wrote:

> On Jan 1, 2007, at 8:36 AM, Chris Hansen wrote:
>
>> In the absence of finalization none of these problems occur because
>> then the collection or non-collection of an unreachable object cannot
>> be observed from the program.
>
> Thanks, this is the compelling argument for C#-style close  
> automation (i.e., the ES4 spec automates close calling on exit from  
> for-in and for-each-in loops only); all other generator use-cases  
> that want close must do it themselves.  As I've said several times,  
> I'm in agreement.  Is everyone else?

Agreed.

My 2p: finalization is the `goto` of GC-ed languages



More information about the Es4-discuss mailing list