lua-users home
lua-l archive

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


Thank you all for your replies!

I was not criticizing the decision, I just wanted to understand what
was the correct syntax rule was ;)


KR

On 21 October 2011 17:07, Roberto Ierusalimschy <roberto@inf.puc-rio.br> 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"].
>> >
>> [...]
>>
>> 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.
>
> A detail: This is not "in addition"; it is exactly the same rule. "end"
> is not a valid identifier.
>
> -- Roberto
>
>