lua-users home
lua-l archive

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


Hello LuaUsers!

Working with require function I found it's strange behaviour:

in ll_require function (loadlib.c)

  lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED");
  lua_getfield(L, 2, name);
  if (lua_toboolean(L, -1))  /* is it there? */
    return 1;  /* package is already loaded; return its result */
  /* else must load it; first mark it as loaded */
  lua_pushboolean(L, 1);
  lua_setfield(L, 2, name);  /* _LOADED[name] = true */

  ^^^^^^^^^^^^ it is marked as loaded, but real loading may fail.
When next time I try to call require function, it event don't try to
load module.
  
-- 
Best regards,
Stukov
mailto:Stukov@gala.net