lua-users home
lua-l archive

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


On Sat, Jan 16, 2010 at 16:40, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> BTW, how it is possible (within Lua defined by the manual) to get
>> different results for lua_version called with a state and with NULL? I
>> think I understand why luaL_checkversion is there, but lua_version
>> existence suggests that version mismatch may be legal. Is it so?

> This is provided to detect multiple instances of the Lua core in an app.
> For instance, an app might have Lua statically linked into it and then
> dynamically link a Lua library that by mistake also includes a Lua core.
> Then a library function may be handed a Lua state created by the core
> in the app and not by the one in the library. We've had reports of obscure
> bugs when that happens in 5.1. Search the archives for dummynode.

Aha! I've missed that these function return a pointer. Makes sense then.

That should be useful, thanks!

Alexander.