lua-users home
lua-l archive

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


David Haley wrote:
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"].

Thanks.

You are right. I replied to Javier's message which also enlightened me on this issue.

So much to learn and understand. :)

But what a great resource this mailing list is.

All you guys and gals are great.

Thanks.

Jimmie