[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: avoiding recursion in a dump_table function
- From: Frank Meier-Dörnberg <frank@...>
- Date: Tue, 10 May 2011 18:37:08 +0200
On 10.05.2011 17:51, Dave Collins wrote:
Aahhhhh!
Yes!
I would like to see something in the lines of
function dump(t)
local seen = {}
local function recurse(t)
-- do the work here
if type(v)=="table" and not seen[v] then
seen[v] = true
recurse(v)
end
end
Question #1: Correct?
Question #2: Tail Call?
--Frank