Created
October 16, 2014 22:18
-
-
Save nefftd/6ddaa23b27e84f73fa6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- String functions | |
local tsa_r -- recursion TSA | |
local tsa_a -- array-based TSA | |
do | |
local function _tsa(n,a,...) | |
if n > 0 then | |
return tostring(a),_tsa(n-1,...) | |
end | |
end | |
function tostringall(...) | |
local n = select('#',...) | |
if n > 0 then | |
return _tsa(n,...) | |
end | |
end | |
tsa_r = tostringall | |
end | |
do | |
-- Alternate tostringall | |
function tostringall(...) | |
local n = select('#',...) | |
local s = {...} | |
for i = 1,n do | |
s[i] = tostring(s[i]) | |
end | |
return unpack(s,1,n) | |
end | |
tsa_a = tostringall | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment