[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Suggestion for Lua 5.3.0 -- require search paths
- From: Andrew Starks <andrew.starks@...>
- Date: Mon, 7 Apr 2014 01:36:06 -0700
On Monday, April 7, 2014, Enrico Colombini <erix@erix.it> wrote:
On 07/04/2014 0.01, Petite Abeille wrote:
In any case, one could always use, say, arg[ 0 ] in the main module
for the same effect.
I just did that in a program I am writing (not extensively checked, it works on my Windows system):
-- tell 'require' to look first into the directory
-- containing this script
local maindir = string.match(arg[0], '(.-)[^\\/]+$')
package.path = maindir .. '?.lua;' .. package.path
-- load required modules
loader = require('m_loader')
compiler = require('m_compiler')
streamer = require('m_astream')
coder = require('m_codegen')
writer = require('m_writer')
(I suppose package.cpath should be changed too if C modules are required)
--
Enrico
Wasn't this default 5.1, until it was deamed a security risk?
- References:
- Running multiple threads in a lua state, Milind Gupta
- Re: Running multiple threads in a lua state, Javier Guerra Giraldez
- Re: Running multiple threads in a lua state, Coroutines
- Re: Running multiple threads in a lua state, Luiz Henrique de Figueiredo
- Re: Running multiple threads in a lua state, Coroutines
- Re: Running multiple threads in a lua state, Sean Conner
- Re: Running multiple threads in a lua state, Coroutines
- Re: Running multiple threads in a lua state, Sean Conner
- Re: Running multiple threads in a lua state, Rena
- Re: Running multiple threads in a lua state, Coroutines
- Suggestion for Lua 5.3.0 -- require search paths, tonyp
- Re: Suggestion for Lua 5.3.0 -- require search paths, Petite Abeille
- Re: Suggestion for Lua 5.3.0 -- require search paths, Valerio Schiavoni
- Re: Suggestion for Lua 5.3.0 -- require search paths, Petite Abeille
- Re: Suggestion for Lua 5.3.0 -- require search paths, Enrico Colombini