lua-users home
lua-l archive

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


For example:

  t = { {fc32="MVER", 13}, NAME="forty", 9 }

Can I convert t to a string in some way that would make it easy to print
the table as a string?

I'm new to lua, so I'm thinking of how ruby can dump data:

  % ruby -e 'h = { "foo" => "bar", 12 => 16, "n" => 2 }; p h'
  {"n"=>2, 12=>16, "foo"=>"bar"}

I don't need the string to be valid input back to lua, just a reasonable
compact representation of the table contents.

I've looked over the ref manual, but I'm not seeing anything that will
help me. Whats the lua way to do this?

Thanks,
Sam