Skip to content

Instantly share code, notes, and snippets.

@nefftd
Created July 14, 2014 02:10
Show Gist options
  • Save nefftd/2564edbc8095b5e1d14d to your computer and use it in GitHub Desktop.
Save nefftd/2564edbc8095b5e1d14d to your computer and use it in GitHub Desktop.
-- WITHOUT tab separators
local function _tsa(n,a,...)
if n > 0 then
return tostring(a),_tsa(n-1,...)
end
end
local function tostringall(...)
local n = select('#',...)
if n > 0 then
return _tsa(n,...)
end
end
function print(...)
io.stdout:write(tostringall(...))
io.stdout:write('\n')
end
-- WITH tab separators
local function _tsa(n,a,...)
if n > 0 then
return tostring(a)..'\t',_tsa(n-1,...)
end
end
local function tostringall_sep(...)
local n = select('#',...)
if n > 0 then
return _tsa(n,...)
end
end
function print(...)
io.stdout:write(tostringall_sep(...))
io.stdout:write('\n')
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment