[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: package.searcher modification for lua modules
- From: Rena <hyperhacker@...>
- Date: Tue, 22 Sep 2015 17:07:23 -0400
On Sep 22, 2015 11:43 AM, "Milind Gupta" <email@example.com> wrote:
>> > Why does everybody assume "org" is the "main" module when it's not? It's
>> > not "org" with "conman.syslog" as a submodule, it's "org.conman.syslog".
>> > The first two levels, "org.conman" just namespace my modules.
>> > Geeze, I might have to make "org.flummux.syslog" just to prove the point!
>> > -spc (I must be the odd-man out ... )
>> Well, I am with you: note that a certain Lua project has a bunch of
>> modules with names such as "luarocks.fetch", "luarocks.fs.unix.tools",
>> and so on, and there is no main module called "luarocks".
>> -- Hisham (let's make some T-shirts "namespacing is not a crime")
> I don't think namespacing is a crime :) . But even if it is a namespace I would have thought that I would want to place things with 1 namespace in a particular location. Currently with org.conman.syslog and say org.conman.xx and with a lua path C:\a\b\c\..\?\d\?.lua It would try to find xx and syslog in 2 different directories. I would think it doesn't matter if you have it as a namespace or a sub module the intention was that things inside a particular redirection reside location. Maybe I am missing some other cases that would fail.
It sounds like what you're saying is require("syslog") should succeed whether you have org.conman.syslog or foo.bar.syslog or even just syslog?