lua-users home
lua-l archive

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


On Tue, 28 Dec 2010 21:45:04 +0200, Richard Hundt <richardhundt@gmail.com> wrote:

Is there something inherently Bad about doing this?

for k,v in next, t, #t > 0 and #t or nil do
    ...
end

yes.

ipairs stop at the first 'nil', and this code loses
all values from there to the '#t'.