function print_r( t ) local print_r_cache={} local space = " " local function sub_print_r(t, indent) if (type(t) == "table") then for pos, val in pairs(t) do if (type(val) == "table") then print(indent .. pos .. " = " .. "{") sub_print_r(val, indent .. space) print(indent .. "},") else print(indent .. pos .. " = " .. tostring(val) .. ',') end end else print(indent .. tostring(t)) end end if (type(t)=="table") then print("{") sub_print_r(t, space) print("}") else sub_print_r(t, space) end end