lua-users home
lua-l archive

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


> That would confuse "C" people.

Lua never gave a dime to how it compares to C or to make similar or
non-confusing dissimilarities.

Otherwise # to be a shorthand for length for the innermost array would
be a welcome shortening, and in some cases even more efficient.


Compare
a.b.c.d.e[#] = 1
with
a.b.c.d.e[a.b.c.d.e.length] = 1

Where the former only walks to look up chain through once, to gain
same performance with current lua, you need a temporary variable.