[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: index tag method
- From: Reuben Thomas <rrt1001@...>
- Date: Wed, 14 Feb 2001 11:22:10 +0000 (GMT)
> 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