[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Recursive require
- From: Wim Couwenberg <w.couwenberg@...>
- Date: Tue, 21 Mar 2006 18:31:03 +0100
> 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