lua-users home
lua-l archive

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


On Thu, Jun 16, 2011 at 8:32 PM, HyperHacker <hyperhacker@gmail.com> wrote:
> I've been working on a Lua binding generator/C preprocessor, and one
> thing I'd love to support is to be able to write a function definition
> like (in C):
> @function myfunc(integer n, boolean b, integer n2 = 12) { ... }
> that would translate to something like:
> int myfunc(lua_State *L) {
>    lua_Integer n = luaL_checkinteger(L, 1);
>    bool b = luaL_checkboolean(L, 2);
>    lua_Integer n2 = luaL_optint(L, 3, 12);
> }

The LuaMacro lc.lua I used with winapi does almost exactly that -
convergent thinking!

And yes, there is a lack of completeness - although they are easy
macros to write.

steve d.