[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Overdoing 'local' (Was: [ANN] luaposix 33.4.0 released)
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 29 Feb 2016 14:12:48 +0200
On Sun, Feb 28, 2016 at 11:53 AM, Nagaev Boris <bnagaev@gmail.com> wrote:
> local conman = require "org.conman"
> conman.process.fork(...)
> conman.getopt.foo(...)
> etc
>
> Just one local variable.
Someone is going to say "but then you have to pull all the libraries
in!". Not necessarily. With a little bit of metamethod magic on
conman, can load submodules only when accessed.
> The global namespace was created to be polluted and the locals were
> created to keep things clear.
Well said. Putting stuff in globals is not necessarily evil; we let
stock Lua do that ;)
steve d