[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Suggestion for Lua 5.3.0 -- require search paths
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 7 Apr 2014 11:52:08 +0200
On Mon, Apr 7, 2014 at 11:46 AM, Chris Emerson
<chris-lua@mail.nosreme.org> wrote:
> source, parse it/alter to get the path (possibly handling different filesystem
> types - Unix, case-insensitive Windows, etc.), in every Lua script. By its
> nature, you can't just pop it into a module you require().
I haven't had any problems with pl.app.require_here
https://github.com/stevedonovan/Penlight/blob/master/lua/pl/app.lua#L26
which uses the arg[0] trick. Just needs a single line to be added to
the designated "main script"
require 'pl.app'.require_here()
...'local requires'
...
Works on every platform I've tested on, but I'd appreciate if anyone
could find a hole in this scheme....
- References:
- 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, Chris Emerson