lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Oct 21, 2011 at 12:54 PM, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
>> we don't have to do a require"io" or require"table" before using them
>
> But you *can* do the requires. So, if you feel better using them, by all
> means do it.

Writing code that does nothing doesn't make me feel better.

Its a null OP, nobody does it, and in the rare lua environments where
it actually did load the table module, it would cause it to be
injected into the global namespace, would it not?

So, the standard lua modules display the "pollution" problem that the
5.1 module() function is being criticized for.

If you don't like modules to be implicitly created as globals by
require, then in lua 5.2 this should be true:

assert(not string)
local s = require"string"
assert(not string)
assert(s.gsub)

Cheers,
Sam