lua-users home
lua-l archive

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


Jérôme Vuarand wrote:
2007/5/28, Sam Roberts <sroberts@bycast.com>:
I think Jerome's right the the fenv is more suited. I forgot there isn't
a one-shot for sharing the same upvalue among multiple c functions. I
was thinking of luaL_openlib(), but it requires the seed to be in a
table to be shared.

That's exactly what I meant. You can share the upvalue only if it is
of a type handled by reference in Lua. That is not the case for
numbers, so you have to wrap it in a table, or eventually a full
userdata to gain some speed.

I understand. Thanks for your advice, gentlemen!