should "require" return module/nil instead of true/false?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: should "require" return module/nil instead of true/false?
- From: "Guangxian Zou" <trueweck@...>
- Date: 2006年6月28日 17:15:07 +0800
hi all
If there is a file a/b.lua:
--- begin
module("c.d")
function foo()
end
--- end
load this module with
require("a/b"); -- or require("a.b"), or require("a\\b")
will return true/false.
but require("c.d") will return the module loaded.
so there is ambiguity. I think require("a/b") should return module also when succeed, but return nil when faild.
do you think so ?
thanks
--
zou guangxian