[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Reserved words as table index names. (Was [ANN] Lua BitOp 1.0.1 released)
- From: "Mike Panetta" <panetta.mike@...>
- Date: Wed, 7 Jan 2009 09:49:53 -0500
Hmm... I wonder how hard it would be to change the parser so that when a table is being indexed with . or : it acts similar to other languages (such as ruby) and interprets everything after the . or : up to the first bit of white space explicitly as a name. In ruby (and probably python) something.and is legal.
This might be a nice feature for the next release...
On Wed, Jan 7, 2009 at 9:32 AM, Joseph Stewart <firstname.lastname@example.org>
Check http://www.lua.org/manual/5.1/manual.html#2 (2.1 Lexical Conventions).
On Wed, Jan 7, 2009 at 9:27 AM, Mike Panetta <email@example.com>
Even when used as part of a table (index) name? Other languages allow this I think. I know python and ruby support using and, or, etc instead of &&, || etc. Ill have to try it and see.
On Wed, Jan 7, 2009 at 9:24 AM, Joseph Stewart <firstname.lastname@example.org>
Because "not", "and", "or" are lua keywords and cannot be used as symbols.