lua-users home
lua-l archive

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


> namespaces/modules... do you plan to implement them by adding to
> Lua's syntax and semantics?

I think that modules should involve new syntax, preferably just a new
reserved word or two. Otherwise, I suspect they won't end up forcing
themselves on the programmer enough to be used (is this a problem in Perl?).

While it should certainly remain possible to write non-modular Lua (for
quick scripting), it should ideally work by making scripts a special case.
For example, in Haskell, the equivalent to C's main function is the Main
module (every program must have one). The Main module is the only one that
doesn't need a module declaration, so if the compiler finds a module without
a declaration, it assumes it's main.

This sort of defaulting gives backwards compatibility (with the exception of
new reserved words) while allowing the new syntax to give a definite feel to
modules when they are being used.

-- 
http://sc3d.org/rrt/ | plagiarism, n.  the mind burgles