lua-users home
lua-l archive

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


Gabriel:

On Sun, Jun 16, 2019 at 1:26 AM Gabriel Bertilson
<arboreous.philologist@gmail.com> wrote:
> A simple testcase. Running it in the 5.4 interpreter (with newlines
> removed) prints "closing" twice for me:
> local x = setmetatable({}, { __close = function () print('closing') end })
> local <toclose> copy1 = x
> local <toclose> copy2 = x

Thanks, I did a similar one, but I asked to make sure that there is no
"as toclose vars are const the compiler is free to optimize one of
them if it can prove they store the same value" hidden somewhere, as
it happened with my interpretation of object uncollectability, due to
some misguided interpretation of the manual. I'm nearlly sure current
version does that, but wanted to avoid future problems in my dessign.

Francisco Olarte.