[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is the registry needed?
- From: Daurnimator <quae@...>
- Date: Wed, 30 Sep 2015 14:18:39 +1000
On 30 September 2015 at 14:01, William Ahern <william@25thandclement.com> wrote:
> I've never encountered naming conflicts when using the registry.
I haven't seen one in practice **yet** but I do think about it.
I like the idea of matching C typedefs to metatable keys (as used by
luaL_newmetatable, luaL_checkudata, etc).
The hope actually *being* that other modules might use it too.
This way another person may create their own sigset_t containing
userdata, but can still use my functions.
e.g. I have a userdata that contains a sigset_t
(https://github.com/daurnimator/lua-spawn/blob/master/spawn/sigset.c),
I chose to use the string "sigset_t" in the registry for it.
I'm not yet sure if this idea is brilliant or stupid...