lua-users home
lua-l archive

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


On Tue, Nov 20, 2012 at 01:13:05PM +0000, Jerome Vuarand wrote:
> Well the easy solution is to use the tostring function (not
> lua_tostring). It accepts any Lua value, and gives you a string. Most
> thrown errors are already strings anyway, and if you throw custom
> objects you can give them a __tostring metamethod that tostring will
> invoke.

I'll try this.

> And as for the "single change", it has a big impact. Whether you pass
> a valid string or NULL, luaL_register will create a new table on the
> stack or not.

I think what I don't understand is do I need to add this string
parameter?  The code seems to work fine at the moment (using NULL), so
I'm inclined to just leave it alone.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
New in Fedora 11: Fedora Windows cross-compiler. Compile Windows
programs, test, and build Windows installers. Over 70 libraries supprt'd
http://fedoraproject.org/wiki/MinGW http://www.annexia.org/fedora_mingw