|
|
|
|
|
by rweichler
3311 days ago
|
|
Idk. Still not sold. You can do list comprehensions in regular Lua with something like this: function listcomp(t, f)
local r = {}
for k,v in pairs(t) do
r[k] = v
end
return r
end
And then, your Lua code would be like: listcomp({1, 2, 3, 4}, function(k, v)
return v*2
end)
Which would be the equivalent to this in MoonScript: [v*2 for k,v in pairs({1, 2, 3 ,4})]
I dunno. Just seems like a wash to me. And then you think about the extra compile step to run MoonScript, and the potential performance hits, and I'm just turned off completely from it. |
|