[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Function to improve on 'print(table)'...
- From: PA <petite.abeille@...>
- Date: Sun, 19 Aug 2007 10:44:17 +0200
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"