lua-users home
lua-l archive

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


Question: should we start recommending that people use require for standard libraries, too? :

local math = require "math"

I'd personally like to move in that direction...

I do this within LuaSocket's modules because I get rid of the namespace
metatable and therefore I have no globals at all after that. :)

I agree that for the command-line interpreter, this would be a pain. Maybe autoloading, as Mark proposed, is a solution. Outside of
command-line, people should actually require everything into locals
anyways, so I don't think removal would hurt anyone. On the contrary.