4 ms·
Most of the times I use foreach loops like for i, x in ipairs(mylist) do so the 0 vs 1 based indexing is made irrelevant. There are some times where mess u
by ufo 14y ago
Most of the times I use foreach loops like
for i, x in ipairs(mylist) do
so the 0 vs 1 based indexing is made irrelevant. There are some times where mess up but overall most Lua users don't think its much of an issue. (Personally, I find the lack of a ternary conditional operator much more annoying)
- bsg75 14y agoipairs is deprecated in 5.2, no? What is the alternative?
- anders 14y agowhere'd you get that from? it's not deprecated: http://www.lua.org/manual/5.2/manual.html#8.2 http://www.lua.org/manual/5.2/manual.html#8.2
- bsg75 14y agohttp://www.corsix.org/content/look-lua-52-work3 http://www.corsix.org/content/look-lua-52-work3 (#19) http://lua.2524044.n2.nabble.com/petition-to-keep-ipairs-alive-td5075892.html http://lua.2524044.n2.nabble.com/petition-to-keep-ipairs-ali... Edit: both are from 2010. This never became final perhaps?
- ufo 14y agoHmm, weird. It definitely isn't deprecated now, according to the docs[1] and I haven't seen anyone complain about ipairs recently ever since I learned the language ^^. But anyway, the only real downside about ipairs is efficiency so even if they removed it I would probably just add it back myself as a regular function. [1] http://www.lua.org/manual/5.2/manual.html#pdf-ipairs http://www.lua.org/manual/5.2/manual.html#pdf-ipairs
- bsg75 14y agoApparently no longer planned: http://lua.2524044.n2.nabble.com/ipairs-deprecated-td7647152.html http://lua.2524044.n2.nabble.com/ipairs-deprecated-td7647152...