lua-users home
lua-l archive

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


David Given wrote:
> > 4) table.maxn
> > 5) deprecated table.setn
> 
> Again, these are Lua 5.0-isms that are now deprecated in Lua 5.1. Use
> #table instead.

That's true for table.setn.

But table.maxn is not deprecated. It's just a very slow and very
stupid function that anyone could write themselves quickly (for the
few cases where you *really* need it). It should never have found
its way into the Lua codebase, but my veto was ignored back then.

I also predicted it would be misused. Nowadays, newbies amongst
the WoW modders use table.maxn all over the place, where they
really should use #t. Drats.

--Mike