lua-users home
lua-l archive

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


	Hi Roberto,

1) Following Diego's suggestion, require "a.b" would first require "a".
Unlike his suggestion, however, fails in that require are not silently
ignored. (You can simply add an empty "init.lua" file into directory
"a" to satisfy that require.)
	Then, if a package doesn't have module "a", it will fail to
load.  A real case is LuaSQL: it is installed as a unique dynamic library,
inside directory luasql (in "cpath").  Now it will have another file
which will be installed in another directory tree ("path").  In a Unix box:

/usr/local/lib/lua/5.1/luasql/driver.so
/usr/local/share/lua/5.1/luasql.lua (or luasql/init.lua)

	Am I correct?

2) The Lua loader is called before the C loader. The motivation is that
Lua is more dynamic than C, and so it is easier to change/correct Lua
modules and they need precedence for those changes/corrections to have
effect.
	And there will be a way to force the load of the C module?
I mean, inside a.lua, how could I load a.so?  I know that today this is
not possible (LuaSocket does a trick to achieve that), but do you plan
to provide that?
		Tomas