On Tue, Nov 10, 2009 at 8:56 PM, Steven Johnson
<steve@xibalbastudios.com> wrote:
Another debugging one here. This one takes a formatted output function
(and you can register one to act as the default) and
then applies that line-by-line. The line-by-line thing lets us dump to
arrays or other structures (e.g. a vector or linked list of
strings on the C side), which can sometimes be easier to traverse.
Also handles cycles and arbitrary keys, and respects
__tostring; it ignores metatable and environment, though maybe I'll
add those as options some day.
Example:
function printf (format, ...)
print(string.format(format, ...))
end
var_dump.Print(MyVariable, printf) -- Accepts any value, tables are
just a special case
or
var_dump.SetDefaultOutf(printf)
var_dump.Print(MyBigTable)
License is MIT.