JavaScript got better while I wasn't looking (2017)
eev.ee
eev.ee
e.g C# 7's destructuring is good, but it's no where near as powerful and ubiquitous as JavaScripts.
Lua works the same way, every iteration has different ‘i’ in iterative version of for loop:
local fs = { }
for i = 1, 5 do
table.insert(fs,
function () print(i) end)
end
for i,f in ipairs(fs) do
f()
end
-- 1 2 3 4 5
What Lua lacks is a will of its authors to add real-life features like (de)structuring, __[gs]et, multi-spread, quick lambda syntax, generic classlib, generic byte buffers, etc. Read FRs in mailing list before any release for details. It is a DIY in C kit, but how long do you DIY until it’s annoying?As a long-time Lua 5.1/2 user who likes it, I must admit that with all js quirks and lacks js is simply more practical and that’s what matters.
EDIT: I just realized you want to overload assignment and reading of the table variable, so this doesn't apply.