lua-users home
lua-l archive

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


On Jul 4, 2010, at 12:13 AM, Wim Couwenberg wrote:

> Globals could be deprecated if Lua would support some form of "import"
> construction natively.  For example "import os" would declare "os" to
> refer to a package where it is in scope.  Many programmers are already
> used to such things (packages, namespaces, ...) so less to explain.
> ;-)  And probably "constant" package references such as os.print could
> compile into array indexing so it would be very fast.  (The - growing
> - set of such references into any package is known at compile time.)
> At least to me something like this would feel as a natural next step
> in the development of Lua.

I'm all for this for most development work. I've always liked the simplicity of the Oberon module system.

That said, globals do end up having their place in interactive development, but perhaps there are reasonable ways to work around that.

Mark