lua-users home
lua-l archive

Re: Finding and loading Lua files

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


	Hi Ivan,
> Which seems simple enough. Then the only requirement that remains is to
> install each tool in a folder with some fixed name, so each tool could
> do
> require "tools/someTool"
> or
> require "thisTool/subModule"
> Of course, fixed names could possibly lead to name clashes, as we know,
> but that should happen very rarely, and could be avoided by installing
> different sets of tools into different subfolders, and adding each to
> LUA_PATH.
	Yes. But, adding "C:\Program Files\Lua\?\?.lua" (note the two '?')
to your LUA_PATH could provide a simple way to use libraries that load
other internal Lua files. This way one could install a library like:
aTool\aTool.lua
 \auxiliar.lua
 \another.lua
	And load it with
require "aTool"
	The file aTool.lua would have to
require "aTool/auxiliar.lua"
require "aTool/another.lua"
	And it will work just with a correct LUA_PATH, despite the folder
where "aTool" subfolder was installed.
		Tomas

AltStyle によって変換されたページ (->オリジナル) /