[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: table.setn was deprecate, what is new function to replace it?
- From: Alexander Gladysh <agladysh@...>
- Date: Sun, 1 May 2011 23:50:49 +0400
On Sun, May 1, 2011 at 23:44, Dirk Laurie <dpl@sun.ac.za> wrote:
> On Sun, May 01, 2011 at 09:04:38PM +0200, lin_style wrote:
>> thanks!
> Your subject line was:
> table.setn was deprecate, what is new function to replace it?
> In Lua 5.2, something like this:
> function setn(t,n)
> setmetatable(t,{__len=function() return n end})
> end
But, first, make sure that you still need it.
Alexander.