Re: Change in behaviour of "n" field in Lua 5.1(work)
[
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: "Adam D. Moss" <adam@...>
- Date: 2004年5月23日 22:08:54 +0100
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