Re: Lua 5.2 __len metamethod
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Lua 5.2 __len metamethod
- From: François Perrad <francois.perrad@...>
- Date: 2011年6月19日 11:11:06 +0200
2011年6月19日 Krunal Rao <krunal.rao78@gmail.com>
>
> 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
>