[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Table dot number?
- From: Duncan Cross <duncan.cross@...>
- Date: Fri, 21 Oct 2011 10:37:18 +0100
On Fri, Oct 21, 2011 at 9:58 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> On Fri, Oct 21, 2011 at 10:54 AM, KR <krunal.rao78@gmail.com> wrote:
>> I understand, but what is the exact rule for what is allowed after the dot? Same
>> rules as names for variables?
>
> That's exactly it, 1 is not a valid identifier, so you cannot use the sugar that
> says that t.x == t["x"].
>
> It's consistent with things like { [0] = 1 } in table constructors
>
> steve d.
>
>
In addition, you cannot use Lua keywords after the dot, like 't.end'
or 't.for' - even though they *could* always be unambiguously
distinguished from proper keywords in this context.
-Duncan