In Lua's case, the language is intended to be an embedded scripting language, so any changes that make the language more complex or potentially make the compiler/runtime even slightly larger or slower may go against this objective. If you implement each and every tiny feature, you can end up with a 'kitchen sink' language: ADA, anyone?
I have seen the hash character '#' being added to the front of variables a lot in Lua. What does it do? EXAMPLE -- sort AIs in currentlevel table.sort (level.ais, function (a,b) return a.y < b...
Because control structures in Lua only consider nil and false to be false, and anything else to be true, this will always enter the if statement, which is not what you want either. There is no way that you can use binary operators like those provided in programming languages to compare a single variable to a list of values.
Lua is a powerful, fast, lightweight, embeddable scripting language. Lua combines simple procedural syntax with powerful data description constructs based on associative arrays and extensible semantics.
A table in Lua is a set of key-value mappings with unique keys. The pairs are stored in arbitrary order and therefore the table is not sorted in any way. What you can do is iterate over the table in some order. The basic pairs gives you no guarantee of the order in which the keys are visited. Here is a customized version of pairs, which I called spairs because it iterates over the table in a ...