lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
You can always do

  print(_VERSION)

To find out the incremental version number if you really need to know.

Sorry, this has changed :-). _VERSION in 5.1.1 will print "Lua 5.1".
Use LUA_VERSION from lua.h to get the complete string.
--lhf

I'm looking at the source and seeing:

in lapi.c

const char lua_ident[] =
  "$Lua: " LUA_VERSION " " LUA_COPYRIGHT " $\n"
  "$Authors: " LUA_AUTHORS " $\n"
  "$URL: www.lua.org $\n";

in lua.h

#define LUA_VERSION	"Lua 5.1.1"

in lbaselib.c

static void base_open (lua_State *L) {
  ...
  lua_pushlstring(L, LUA_VERSION, 7);
  lua_setglobal(L, "_VERSION");  /* set global _VERSION */
  ...
}

So I'm pretty sure that, oh...you've limited the string to 7 chars. ;-)

My face is red.

Ralph