lua-users home
lua-l archive

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


On Dec 28, 2010, at 2:31 PM, Steve Litt wrote:

> On Tuesday 28 December 2010 16:15:39 Mark Hamburg wrote:
>> On Dec 28, 2010, at 11:45 AM, Richard Hundt wrote:
>>> Is there something inherently Bad about doing this?
>>> 
>>> for k,v in next, t, #t > 0 and #t or nil do
>>>  ...
>>> end
>> 
>> There is nothing in the contract for next that guarantees that it will
>> work.
> 
> Can somebody please explain how Mark's algorithm works? In the docs at 
> http://www.lua.org/manual/5.1/manual.html it lists the following syntax for 
> next():

Not mine. Richard Hundt's. I hardly want to be credited with something I don't recommend.

Mark