|
- lua - How to dump a table to console? - Stack Overflow
I'm having trouble displaying the contents of a table which contains nested tables (n-deep) I'd like to just dump it to std out or the console via a print statement or something quick and dirty bu
- What is the alternative for switch statement in Lua language?
In general, if you want a switch statement in Lua, what you ought to be doing is building a table For your simple case of choice that could be 1, 2, or fail, a simple if statement with a few conditions is sufficient
- arrays - How to iterate through table in Lua? - Stack Overflow
Edit: Note that Lua doesn't guarantee any iteration order for the associative part of the table If you want to access the items in a specific order, retrieve the keys from arr and sort it Then access arr through the sorted keys: local ordered_keys = {} for k in pairs(arr) do table insert(ordered_keys, k) end table sort(ordered_keys)
- function - Difference between . and : in Lua - Stack Overflow
Difference between and : in Lua Asked 14 years, 5 months ago Modified 11 months ago Viewed 79k times
- require - Load Lua-files by relative path - Stack Overflow
But inside mylib lua I would also like to load other necessary modules and I don't feel like always specifying the full path (e g mylib mylib-utils) If I ever decide to move the folder I'm going to have a lot of search and replace
- Why does Lua have no continue statement? - Stack Overflow
The Lua authors felt that continue was only one of a number of possible new control flow mechanisms (the fact that it cannot work with the scope rules of repeat until was a secondary factor )
- What is the difference between pairs() and ipairs() in Lua?
In a for loop, what is the difference between looping with pairs() versus ipairs()? The Programming in Lua book mentions both, however, both appear to generate similar outputs as shown below: Using
- Inline conditions in Lua (a == b ? yes : no)? - Stack Overflow
There is a nice article on lua-users wiki about ternary operator, together with problem explanation and several solutions
|
|
|