lua-users home
lua-l archive

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


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
>
>