On Oct 24, 2007, at 18:13, PA wrote:
Alternatively... a more baroque approach could use a function environment and therefore not require an additional argument, e.g.:Sure... roll your own... e.g.:
local function quote( aValue )
return ('%q'):format( tostring( aValue ) )
end
local t = { 'hi', 5, nil, 4, function() end, {} }
setfenv( concat, { encoder = quote } )
print( concat( t, ' ' ) )
> "hi" "5" "nil" "4" "function: 0x103dc0" "table: 0x103de0"
Attachment:
TestTable.lua
Description: Binary data