2013-12-27 03:49:04 +00:00
|
|
|
-- Extra useful functions
|
|
|
|
|
|
|
|
-- Create sequence of expressions.
|
|
|
|
-- Examples:
|
|
|
|
-- local a, b, c = Consts("a,b,c")
|
|
|
|
-- We can use ';', ' ', ',', tabs ad line breaks for separating the constant names
|
|
|
|
-- local a, b, c = Consts("a b c")
|
|
|
|
function Consts(s)
|
2014-01-13 01:38:29 +00:00
|
|
|
local r = {}
|
|
|
|
local i = 1
|
|
|
|
for c in string.gmatch(s, '[^ ,;\t\n]+') do
|
2013-12-27 03:49:04 +00:00
|
|
|
r[i] = Const(c)
|
|
|
|
i = i + 1
|
|
|
|
end
|
|
|
|
return unpack(r)
|
|
|
|
end
|