lua-users home
lua-l archive

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


2013/3/1 Coda Highland <chighland@gmail.com>:

>
> You could also use a unique userdata and assign a metatable to that.
>

Great idea!

I happen to have made a small library, so far purely for my own use,
that simply offers a small selection of C API functions callable from
Lua.  E.g.

api = require"api"
lua=api.lua
return lua.pop(2,a,b,c,d,e) --> a b c

I mainly use it to debug at the Lua level the logic of modules I write
in C, but some (like lua.pop) are useful for other purposes too.

Until now, I've had lua.newuserdata in, but no useful applications
for it. Thanks for this!