lua-users home
lua-l archive

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


Lua 5.0 (beta) brings lua_version, which returns the string LUA_VERSION.
This can be used in a library to check whether the version of Lua that was
used to compiled it is the same as the version of Lua core linked to it.
In other words, a library might do something like this at its very start:

	if (!strcmp(lua_version(L),LUA_VERSION)) raise_error()

The scheme for loading compiled libraries that is in the wiki does something
similar. Perhaps lua_version can be useful there too.
--lhf