Re: length operator # for tables with metatables
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: length operator # for tables with metatables
- From: Greg Falcon <veloso@...>
- Date: 2009年9月23日 08:41:54 -0400
On Tue, Sep 22, 2009 at 5:53 PM, Leo Razoumov <slonik.az@gmail.com> wrote:
> The real problem is that in a common idiom "t[#t+1]=v" t[i] obeys
> meta-method resolution while #t ignores metatable altogether.
But it's been mentioned on this thread already that in 5.2, #t will
respect a __len metamethod. So what you are calling "the real
problem" has already been addressed.
Greg F