lua-users home
lua-l archive

Re: package.loaders -> Is modifying it supported?

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


Shaun wrote:
Hi All,
I notice that Lua 5.1 introduces a new table, package.loaders that includes a series of functions that are invoked trying to satisfy a 'require' statement. Is it this table supported? Is it ok to modify it (from the code that embeds LUA) to introduce generic loaders that should be executed before the existing ones?
I have done this in my system to use my own file lookup logic and to load non-lua files using require. It works like a champ.
--
chris marrin ,"",ドル
chris@marrin.com b` $ ,,.
 mP b' , 1$'
 ,.` ,b` ,` :$$'
 ,|` mP ,` ,mm
 ,b" b" ,` ,mm m$$ ,m ,`P$$
 m$` ,b` .` ,mm ,'|$P ,|"1$` ,b$P ,` :1ドル
 b$` ,$: :,`` |$$ ,` $$` ,|` ,$,,ドル`"$$ .` :$|
b$| _m$`,:` :1ドル ,` ,$Pm|` ` :$,ドル..;"' |$:
P$b, _;b$$b1ドル" |$$ ,` ,$$" ``' $$
 ```"```'" `"` `""` ""` ,P`
"As a general rule,don't solve puzzles that open portals to Hell"'

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