lua-users home
lua-l archive

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


Hi,

Varol explained the #t issue, so here's the other one:

>> =items.0007126409
> stdin:1: '<eof>' expected near '.0007126409'
> 
> doesn't work, but this does.
> 
>> return items['0007126409']
> table: 0x8089bf0

This is, I believe, because the "string" is being parsed as a number,
and not an identifier. The manual says that the syntax is var.Name,
where Name is an identifier, i.e.:

"Names (also called identifiers) in Lua can be any string of letters,
digits, and underscores, not beginning with a digit."

So, since 1234 is not an identifier, the syntax t.1234 is not the same
thing as t["1234"].

Cheers,
- David

-- 
~David-Haley
http://david.the-haleys.org