lua-users home
lua-l archive

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


Jörg,

On Feb 6, 2007, at 8:46 AM, Richter, Jörg wrote:


I think the best solution would be to allow reserved words in table constructors.


This complicates lexical analysis. An example:  in the fragment "{ function =" 'function' would be a field name, and in the fragment "{ function (" 'function' is a key word. In the fragment "; function" you have to know whether you are in a table constructor or not. This eliminates the nice logical separation between the parser and the lexical analyzer.

The Lua implementation is nice, small and fast, in part because its creators have resisted adding stuff that's only marginally useful. Adding complications like this would not be high on my priority list.

You can always write a Lua 5.x program to convert your files to Lua 6.x compatible syntax if required.

Personally I just use ["thing"]. I don't think it's worth the trouble.



--
Gé Weijers