0

In my lua script, it requires another lua module by following statement:

require 'another'

In my another lua module, the first line of code is:

module(..., )

However, it looks like that Luaj does not has 'module' function defined or not support it at all in the returned global object. I am using luaj 3.0 belter 2. Does it support the module function in luaj? If so, how to use it?

Thanks in advance!

2 Answers2

0

I examined source codes of Luaj 3.0. The 'module' function seems to be not supported in Luaj 3.0. You'd better to use Luaj 2.0.3.

Jay Oh
  • 1
0

There is no more 'module' function in Lua 5.2. Since Luaj 3.0 supports Lua 5.2 only, this is why 'module' function not available any more. In Lua 5.2, there are updates for handling Lua module. The old module functionality in Lua 5.1 has big issue in security and it was discard in Lua 5.2. However, to support old Lua program which is using the old way of Lua module functionality, Luaj 2.0.3 has to be used.