[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors
- From: "szbnwer@..." <szbnwer@...>
- Date: Tue, 25 Jun 2019 18:09:10 +0000
hi there! :)
Sergey Kovalev:
> __unreference should call immediately when reference count to zero,
unliket __gc it is called latter then there is no way to stand more or
when explicitly call collectgarbage()
hmmm, maybe we are talking about the same here, but if not, then what
about optional refcount instead of `<toclose>`?!
that way its just a matter of an entry in the metatable, and it isnt
bound to the variable, so there is no need for the whole `<toclose>`
misery (in the sense, that it opened a large can of worms on lua-l). a
lotsa ppl use their own refcount implementations for a bunch of
things, and that have a much more wide area for its use-cases, but it
can achieve the same as `<toclose>` just as well. (if im right. :D )
i think it could be simply called to `__refcount` and it could be
`nil` or `false` for disabling it (so it will wait for the gc), a
number that would be handled internally, but ppl could also mess with
it, or a function could get it from anywhere without an argument or
set it with an argument.
actually i would be much more happy with such a feature, but whatever,
decide wisely, like u did so far now! :)
bests! :)
- References:
- Lua 5.4.0-alpha-rc1 behavior with closing methods errors, phlnc8
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, David Heiko Kolf
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Francisco Olarte
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, David Heiko Kolf
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Francisco Olarte
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, David Heiko Kolf
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Francisco Olarte
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Sergey Kovalev
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Matthew Wild
- Re: Lua 5.4.0-alpha-rc1 behavior with closing methods errors, Sergey Kovalev