[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Command line library load in Lua 5.2
- From: Dirk Laurie <dirk.laurie@...>
- Date: Wed, 2 Nov 2011 06:55:26 +0200
2011/11/1 Luiz Henrique de Figueiredo <email@example.com>:
>> Now that we are all adjusting to the new way of handling modules, the
>> '-l' command might be extended to allow this:
>> lua5.2 -l mymod=long_and_unwieldy_module_name -i
> mymod would be a global? ie, that'd be translated to
> mymod = require"long_and_unwieldy_module_name"
> In that direction lies a suggestion that modules create globals,
> something that has already been beaten to death here (we hope)...
On the contrary, my point is precisely that all the new good habits of
avoiding pollution of the global namespace is undermined by the Lua5.2
The present behaviour is this:
$ lua5.1 -l mymod -e "print(mymod)"
$ lua5.2 -l mymod -e "print(mymod)"
I.e. the global name is not created by the module, but by the Lua5.2