[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: (not) handling new programming idioms with grace
- From: Roberto Ierusalimschy <roberto@...>
- Date: Sat, 21 Jul 2018 09:01:34 -0300
> The implementation of lfs.dir in LuaFileSystem does close the
> directory handle as it reaches the last element. Unfortunately, that's
> not good enough, because of course, when given a "for" iterator, users
> can (and do) use "break".
That is true. And directory iterations are frequently broken (e.g.,
after finding something). However, as just pointed out in another
thread, none of the proposed mechanisms for deterministic finalization
would be practical for that case, because the variable that needs
finalization is hidden inside the for (or worse, hidden inside the
closure or coroutine used by the for).
-- Roberto
- References:
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, Viacheslav Usov
- Re: (not) handling new programming idioms with grace, John Belmonte
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, Gé Weijers
- Re: (not) handling new programming idioms with grace, Andrew Starks
- Re: (not) handling new programming idioms with grace, Sean Conner
- Re: (not) handling new programming idioms with grace, Roberto Ierusalimschy
- Re: (not) handling new programming idioms with grace, Hisham