lua-users home
lua-l archive

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


On Sat, May 22, 2010 at 3:50 PM, Quae Quack <quae@daurnimator.com> wrote:
> or in the rare situations you do actually need the ipairs function:
> provide/write it.

Ah, but there are thousands of lines of Lua code using ipairs; why break them?

What will happen is a compat52 library, which will re-introduce all
the things we liked in 5.1 ;)

> otherwise how often are you providing literals in your fors?

It's not a common use-case.  I tend to define little iterators called
'iter' or 'list' which just iterate over the values (in order ;))

steve d.

PS I have mixed feelings on this one. On the one hand, if I was
introducing a person to the language, then having both pairs and
ipairs to explain would be tricky - whereas everyone gets numeric for.
  On the other hand, 'active' deprecation leaves little patches of Lua
code out there that tend to break nastily - like 'for k,v in t do'
which I was very fond of at the time.