On Sat, Jul 7, 2012 at 9:53 AM, Benoit Germain <bnt.germ...@gmail.com> wrote:
> I have changed the code to rename the C part lanes.core.
> However, when I luarocks make my rockspec, I get a
> lib\lua\5.1\lanes\core.dll, whereas I would expect
> lib\lua\5.1\lanes.core.dll
>
> Is this intentional? The module gets required just fine though.

Yes.

> The documentation for require() says:
> The first searcher simply looks for a loader in the package.preload table.
> The second searcher looks for a loader as a Lua library, using the path
> stored at package.path.
> The third searcher looks for a loader as a C library, using the path given
> by the variable package.cpath.
> The fourth searcher tries an all-in-one loader. It searches the C path for a
> library for the root name of the given module.
>
> But when I remove core.dll I get this output:
>
> C:\Users\Parents\Code\lanes>lua5.1
> Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
>> =package.path
> C:\SDK\LuaRocks\share\lua\5.1\?.lua
>> =package.cpath
> C:\SDK\LuaRocks\lib\lua\5.1\?.dll
>> require "lanes.core"
> stdin:1: module 'lanes.core' not found:
>         no field package.preload['lanes.core']
>         no file 'C:\SDK\LuaRocks\share\lua\5.1\lanes\core.lua'
>         no file 'C:\SDK\LuaRocks\lib\lua\5.1\lanes\core.dll'
>         no file 'C:\SDK\LuaRocks\lib\lua\5.1\lanes.dll'
> stack traceback:
>         [C]: in function 'require'
>         stdin:1: in main chunk
>         [C]: ?
>
> This doesn't match what the documentation says, from which I understand that
> the second searcher would search for
> C:\SDK\LuaRocks\lib\lua\5.1\lanes.core.lua and the third searcher would
> search for C:\SDK\LuaRocks\lib\lua\5.1\lanes.core.dll.
>
> Did I miss something obvious?

You snipped away this relevant bit from the manual:

"The second searcher looks for a loader as a Lua library, using the
path stored at package.path. A path is a sequence of templates
separated by semicolons. For each template, the searcher will change
each interrogation mark in the template by filename, which is the
module name with each dot replaced by a "directory separator" (such as
"/" in Unix); then it will try to open the resulting file name."

-- Hisham

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Luarocks-developers mailing list
Luarocks-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/luarocks-developers

Reply via email to