lua-users home
lua-l archive

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

On 15 September 2016 at 18:18, Igor Ehrlich <> wrote:
> It is possible that surrounding code will hijack pairs/ipairs. What should I
> do if I doubt whether or not the next/ipairs_aux iterators are really what I
> expect them to be? Will they work as I expect them to work? The safest
> approach here would've been to re-implement them locally and call local
> implementations. After that, I'd post these implementations to this list and
> insist to add them in the next lua release.

IMO you should assume that if the user changed them, they changed them
for a reason.

e.g. In C code you don't go around checking functions do what they're
documented to do just in case someone used LD_PRELOAD.