lua-users home
lua-l archive

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



On Aug 19, 2007, at 08:25, Duck wrote:

It's meant to be a sort of legible serialisation for troubleshooting your data.

I guess you could go the whole nine yards and provide a proper serialization mechanism then :)

"Recursive table print/serialization"
http://lua-users.org/wiki/LuaRecipes

Here is yet another implementation:

http://dev.alt.textdrive.com/browser/HTTP/Data.lua

Usage example:

local Data = require( 'Data' )
local aTable = {}

aTable[ 1 ] = 'banana'
aTable[ 2 ] = { fruit = 'mango', qty = 45 }

print( Data( aTable ) )

> _[1]="banana" _[2]={} _[2]["qty"]=45 _[2]["fruit"]="mango"