[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Change in behaviour of "n" field in Lua 5.1(work)
- From: "Bilyk, Alex" <ABilyk@...>
- Date: Mon, 24 May 2004 11:11:50 -0700
I am with you on the t.n part. My scripts also rely heavily on table.insert/remove updating the size. So, 90% of my scripts will be broken with the next release. I guess others with the same problem would have to reimplement remove/release unless they are taken care of by the standard distro.
Alex.
>-----Original Message-----
>From: Adam D. Moss [mailto:adam@gimp.org]
>Sent: Sunday, May 23, 2004 2:09 PM
>To: Lua list
>Subject: Re: Change in behaviour of "n" field in Lua 5.1(work)
>
>
>Jasmin Patry wrote:
>> Here is a comparison of the new and old behaviours:
>>
>> Old luaL_setn(t, n):
>> if t.n is a number >= 0, set t.n = n
>> else set sizes[t] = n
>>
>> New luaL_setn(t, n):
>> set sizes[t] = n
>
>I hadn't noticed this... I like it MUCH better! :)
>
>> Old luaL_getn(t, n):
>> if t.n is a number >=0, return n
>> else if sizes[t] is a number >=0, return sizes[t]
>> else count the elements.
>>
>> New luaL_getn(t, n):
>> if sizes[t] is a number >=0, return sizes[t]
>> else if t.n is a number >=0, return n
>> else count the elements.
>
>I'd rather the t.n part just went away completely, personally.
>
>--Adam
>--
>Adam D. Moss . ,,^^ adam@gimp.org http://www.foxbox.org/ co:3
>
>