lua-users home
lua-l archive

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


> Lua
> 5.1 complains when require loops (a requires b requires c requires a).

Change the order of require and module calls.  Example:

--- file a.lua ---

local print, require = print, require
module "a"
require "b"
print "module a"

--- file b.lua ---

local print, require = print, require
module "b"
require "c"
print "module b"

--- file c.lua ---

local print, require = print, require
module "c"
require "a"
print "module c"

---------

Example output:

> require "a"
module c
module b
module a

--
Wim