lua-users home
lua-l archive

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


On 8 December 2011 06:06, Florian Weimer <fw@deneb.enyo.de> wrote:
> * Luiz Henrique de Figueiredo:
>
>> We expect this release candidate to be the final version of Lua 5.2.0,
>> unless serious glitches are found soon.
>
> The library search path seems wrong to me:
>
> src/lua: /tmp/t.lua:1: module 'lpeg' not found:
>        no field package.preload['lpeg']
>        no file '/usr/local/share/lua/5.2/lpeg.lua'
>        no file '/usr/local/share/lua/5.2/lpeg/init.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg/init.lua'
>        no file './lpeg.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg.so'
>        no file '/usr/local/lib/lua/5.2/loadall.so'
>        no file './lpeg.so'
>
> I think the correct order would be:
>
> src/lua: /tmp/t.lua:1: module 'lpeg' not found:
>        no field package.preload['lpeg']
>        no file '/usr/local/share/lua/5.2/lpeg.lua'
>        no file '/usr/local/share/lua/5.2/lpeg/init.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg/init.lua'
>        no file '/usr/local/lib/lua/5.2/lpeg.so'
>        no file '/usr/local/lib/lua/5.2/loadall.so'
>        no file './lpeg.lua'
>        no file './lpeg.so'
>
> The idea is that a module is not picked up from the current directory,
> unless it cannot be found elsewhere.
>

Lua files are searched for before C modules (ie, iterates over
package.path before package.cpath)
PS though; adding ./?/init.lua to the default search path is probably useful.