[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua C API prefix naming conventions
- From: Sean Conner <sean@...>
- Date: Tue, 10 Dec 2013 11:54:52 -0500
It was thus said that the Great Marc Lepage once stated:
>
> Anyways, what I've been wanting to do is make my own functions which work
> like Lua functions. For example, Lua has lua_isstring, lua_pushstring,
> lua_tostring, luaL_optstring, and luaL_checkstring. For my own type 'foo'
> (generally a full userdata), I'd like to provide lua_isfoo, lua_ispushfoo,
> lua_tofoo, lua_optfoo, and lua_checkfoo.
In my own code, for functions that are generic Lua routines (not limited
to a single module) is to prefix the function with 'llua_':
llua_pushfoo()
llua_tofoo()
And for modules:
foolua_this();
foolua_that();
(and I just started doing this)
foometa___index();
foometa___newindex();
foometa___gc();
> My question is whether there is a documented list of Lua prefixes reserved
> for use by Lua. It seems like using more than one uppercase letter is safe,
> I'm just curious.
+1.
-spc