[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: syntax
- From: "Mark Meijer" <meijer78@...>
- Date: Wed, 20 Feb 2008 17:29:16 +0100
On 20/02/2008, Javier Guerra <email@example.com> wrote:
> On 2/20/08, Hans Hagen <firstname.lastname@example.org> wrote:
> > but since the reference states that
> > a.name 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?