[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Table dot number?
- From: Patrick Rapin <toupie300@...>
- Date: Fri, 21 Oct 2011 11:30:21 +0200
>> Because it's ambiguous?
> Actually it isn't.
>From the language grammar point of view, it is ambiguous.
But from the programmer point of view, it is.
I think most people would expect t.1 == t, but the parser would
assume t.1 == t["1"].
The dot syntax is a syntax sugar to have named fields in a table.
And I can't find a real world situation were t.1 (meaning t["1"])
could be useful. You can still use t.f1, t._1, ... if you want.