News for hackers. Stuff that matters.
Re:Lua: Good, bad, and ugly parts by johnmo on Saturday March 09, 2013 @12:31PM (#5348985)
> The "hash" part doesn't have a defined length. Both parts can be iterated over using the pairs method, which allows you to count the number of elements in them

While true, you should iterate integer-key tables using ipairs and hash tables using pairs.

> No continue statement

Continue doesn't exist? I swear I've used it in Lua 5.1.

Re:Lua: Good, bad, and ugly parts by vor_ on Saturday March 09, 2013 @02:36PM (#5349342)
There's no continue. Instead, you must use goto.

> While true, you should iterate integer-key tables using ipairs and hash tables using pairs.

In my opinion, this makes Lua's combination of arrays and dictionaries pointless since one must distinguish between them anyway for iteration.

Re:Lua: Good, bad, and ugly parts by Hinrik on Sunday March 10, 2013 @04:02PM (#5353222)
Do you really consider that to be a drawback? How often do you find yourself wanting to iterate a datastructure without knowing whether it's an array or a hash?
Re:Lua: Good, bad, and ugly parts by seany on Saturday March 09, 2013 @01:27PM (#5349136)
ipairs is gone in 5.2
Re:Lua: Good, bad, and ugly parts by Dylan16807 on Saturday March 09, 2013 @02:00PM (#5349237)
They changed ipairs around a couple times. It's currently in.

Either way you should be using not-pairs. If you construct a table in a weird way you can end up with pairs going out-of-order. ipairs works fine, also "for i=1,#t" works fine.