[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] Lua 5.4.0 (alpha-rc2) now available
- From: Hisham <h@...>
- Date: Fri, 21 Jun 2019 14:41:56 -0300
On Mon, 17 Jun 2019 at 05:11, Aapo Talvensaari
<aapo.talvensaari@gmail.com> wrote:
>
> On Wed, Jun 12, 2019 at 3:46 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>>
>> > Right now, my only complain with the <toclose> is the term "close" that I
>> > found a bit vague and over-loaded (conceptually).
>>
>> Suggestions are welcome.
>
>
> Name aside, what about something similar to:
> http://luajit.org/ext_ffi_api.html#ffi_gc
The behavior of ffi.gc is analogous to Lua's already-existing __gc metamethod.
> E.g.
>
> local f = toclose(io.open("myfile"), function(f)
> f:close()
> end)
> io.close(toclose(f, nil))
This is not an option because the to-close behavior in Lua 5.4 is
relative to the variable, not the value.
-- Hisham
- References:
- [ANN] Lua 5.4.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Luiz Henrique de Figueiredo
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Daurnimator
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Coda Highland
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Andrew Gierth
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Coda Highland
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Doug Currie
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, pocomane
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Roberto Ierusalimschy
- Re: [ANN] Lua 5.4.0 (alpha-rc2) now available, Aapo Talvensaari