lua-users home
lua-l archive

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


> What api would you prefer for next? And how did its current api spoil generic for? Thanks.

Probably 'next' should return first some opaque "index" object, to be used
in its next call, and then the key and the value. (The index object could
be, for instance, an integer with the internal current position of the
traversal, but that should not be in the specification.)

Similarly, the control variable in the 'for' loop should be hidden like
the state, and not the first variable declared in the loop.

-- Roberto