[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Make "package.loaded" weak
- From: Daurnimator <quae@...>
- Date: Sun, 19 Feb 2017 20:12:39 +1100
On 19 February 2017 at 20:09, Daurnimator <quae@daurnimator.com> wrote:
> On 19 February 2017 at 18:06, Daurnimator <quae@daurnimator.com> wrote:
>> e.g. a module that registers a metatable with `luaL_setmetatable`
>> inside of it's `luaopen_` function.
>
> Oops, I meant luaL_newmetatable here.
And now reading the docs
(http://www.lua.org/manual/5.3/manual.html#luaL_newmetatable) I
noticed that luaL_newmetatable *doesn't* do anything if the key
already exists.
This is slightly better for the reloading situation: it means that
things won't break as I mentioned earlier with luaL_checkudata.