Re: Explicitly warn about lua_next missing an order guarantee in the reference manual

Javier Guerra Giraldez <[email protected]>
Newsgroups gmane.comp.lang.lua.general
Message-ID <CAFkDaoSJPGGds4cKjSobSZcb37Hzmt=jqMVH0O3+E5JR3Mo23A@mail.gmail.com>
On Wed, 15 Apr 2026 at 19:00, 'Sainan' via lua-l <[email protected]>
wrote:

> > The order in which the indices are enumerated is not specified, even for
> numeric indices.
>
> Well, the order is guaranteed for numeric indecies, as long as those
> numeric indecies start at 1 and increment from there. :^)


only if the numeric indices are actually in the non-guaranteed array part
(which is an optimisation and not part of the spec)
and only for the current implementation (and all implementations so far
that share that specific array-part optimisation)

it's easy to imagine a new implementation that goes through the array part
in reverse order, and possibly do the hash part before the array.  that
would be just as spec-compliant as the current one and would break all that
code that depends on the enumeration order.

-- 
Javier

-- 
You received this message because you are subscribed to the Google Groups "lua-l" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/lua-l/CAFkDaoSJPGGds4cKjSobSZcb37Hzmt%3DjqMVH0O3%2BE5JR3Mo23A%40mail.gmail.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.