lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


25.06.2019, 20:09, "szbnwer@gmail.com" <szbnwer@gmail.com>:
> what about optional refcount instead of "<toclose>" ?

indeed.
i also wondered why not just have optional reference counting at
the programmer's disposal with gc still being the default ?

> that way its just a matter of an entry in the metatable, and it isnt
> bound to the variable

do you intend this to be possible only from C code or from the Lua
side aswell ?

> 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.

optional metatable entry representing a function with an optional
integer argument with default value 1 ?

> actually i would be much more happy with such a feature

agreed.
optional refcounting would not hurt, right ?