lua-users home
lua-l archive

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


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