lua-users home
lua-l archive

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

On 20/02/2008, Javier Guerra <> wrote:
> On 2/20/08, Hans Hagen <> wrote:
> >  but since the reference states that
> >
> > as syntactic sugar for a["name"]
> >
> >  i'd expect the parser to recognize such cases; isn't this tricky with
> >  repect to future extensions (read: new keywords) being used in scripts
> >  as keys already?
> the reference also states that "keywords are reserved and cannot be
> used as names".  that's why the Lua designers are so reluctant to
> introduce new keywords.

But why is it that keywords cannot be used as names? There are patches
etc. around that allow it, and I don't really see the problem with it
(but maybe that's just me). Except that you could maybe "hide" certain
keywords if you use its name in _G or something, but I'd say that is
the programmer's responsibility, like many things in Lua. Isn't the
Lua filosophy to not enforce/restrict, but to empower the programmer
and assume some measure of common sense?