I am trying to print a table may contain tables. However, I fail to get it to print recursively.
function debugTable (t, indent)
    local ind = indent or "";
    local printFunc = print
    if (fibaro or {}).debug then
       function printFunc(...)
          return fibaro:debug(...)
       end
    end
    for k, v in pairs(t) do
        if(type(v) == "table") then
            -- recursive call if table
            debugTable(v, " - ");
        else
            printFunc(ind .. k .." ".. tostring(v));
        end;
    end;
end;
This is a test table:
a = {};
c ={["33"] = 44,["55"]=43}
b = {["12"] = 30, ["11"]= 40,["66"]=c};
a["12"] = 10;
a["10"] = 11;
a["22"] = {10,["13"]=b};
a["11"] = 11;
now, when I print the table, I get this:
> debugTable(a)
 - 1 10
 - 12 30
 - 33 44
 - 55 43
 - 11 40
12 10
10 11
11 11
which is puzzling for me, as I was expecting a deeper tree than what I got. What I am missing?
 
     
     
    