lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I just came up with a better idea, which only introduces minimal
> changes into the language, but allows a removal of the __ipairs
> metamethod, yet avoiding re-evaluating the length for every
> iteration step: adjusting Lua's for-statement in such way that more
> than one state variable can be passed.

It wasn't you who said that this is not enough?

| 3. Removing the __ipairs metamethod mechanism is not just about
|    the overhead (and speed) of the # operator:
| 
|    a) Beside the repetitive call of luaB_ipairs, it is not
|       possible to return a precalculated value as second item of
|       the iterator triplet that may speed things up.
|       [...]

-- Roberto