lua-users home
lua-l archive

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


On 5/30/06, google <google@kinghoo.net> wrote:
If I have a statement like:

        somedata.foo(arg1,arg2)

now,what is the type of somedata? a table or a userdata?

according to the reference manual in

2.3 - Variables

"The syntax var.NAME is >>just<< syntactic sugar for var["NAME"]:

        var ::= prefixexp '.' Name"

"Square brackets are used to index a table:

        var ::= prefixexp '[' exp ']'

The first expression (prefixexp)  >>should<<  result in a >>table<< value;"

Now,according to the reference manual,the somedata is a table.
But really it is a userdata. Is there something Wrong?


might be a metatable to an userdata. kindly check the section on
metatables

http://www.lua.org/manual/5.0/manual.html#2.8

--
salud,
eyan

http://www.eyan.org