[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Non-uniqueness of module names
- From: Sean Conner <sean@...>
- Date: Fri, 12 Apr 2019 15:37:44 -0400
It was thus said that the Great Abhijit Nandy once stated:
> So why aren't the paths from where the modules are loaded, simply kept in a
> table mapped to the module name?
Because not all Lua modules have a path. Aside from the builtin modules
like io or table, it is possible to modify the module system to load modules
not on the filesystem. At work, I have a custom Lua interpreter that embeds
all the Lua modules we need into a single Lua executable. This includes
modules written in C and Lua [1]. There is no path for these modules.
Then I played around with an idea to load Lua modules directly from a zip
file [2][3]. What's the path for these? That of the zip file? It doesn't
make sense.
-spc
[1] http://boston.conman.org/2013/03/23.1
[2] http://boston.conman.org/2018/02/19.2
https://github.com/spc476/LEM
[3] It kind of worked, in that I could load and run Lua modules written
in Lua directly from the zip file, but not those written in C.