8 ms·
Lua also has for i, v in ipairs (t) do -- i is the index, v is the value end Not getting the index in C++ easily was very frustrating. Often i
by ReactiveJelly 5y ago
Lua also has
for i, v in ipairs (t) do
-- i is the index, v is the value
end
Not getting the index in C++ easily was very frustrating. Often in C++ I fall back on C-style for-loops just because the functional stuff is hard to remember.
In Rust it doesn't give you the index by default, but the `enumerate` adapter adds an index anywhere in a functional pipeline.