lua-users home
lua-l archive

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

2011/6/19 Krunal Rao <>
> In Lua 5.2 it is possible to define the __len metamethod (# operator
> method) for tables as well.
> Is there a way to access the raw (primitive) length operator for a
> table which has a custom __len defined in the same way as rawget /
> rawset allow this for __index and __newindex?

yes, there is a new basic function : rawlen (v)
  Returns the length of the object v, which must be a table or a
string, without invoking any metamethod. Returns an integer number.

> Thank you