lua-users home
lua-l archive

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

On Mon, Nov 3, 2008 at 11:20 PM, Robin Vossen <> wrote:
> What are the Diffrences?
> Oh, and did I do the funtion right?
> luaL_reg(L, "setDefaultSettings", setDefaultSettings());
> Since I do get an error now.
> But to be honest I didn't really check on that Error yet.

I'd have to guess that setDefaultSettings isn't returning a function
pointer when you call it, and that you meant
  luaL_reg(L, "setDefaultSettings", setDefaultSettings);
instead.  A Lua userdata seems to be roughly what you want though
(although functions/closures are certainly useful too, and Lua tables
with metatables are also very flexible).

-- James