Top "Lua" questions

Lua is a powerful, fast, lightweight, embeddable scripting language.

Generating uniform random numbers in Lua

I am working on programming a Markov chain in Lua, and one element of this requires me to uniformly generate …

random lua random-seed
Load Lua-files by relative path

If I have a file structure like this: ./main.lua ./mylib/mylib.lua ./mylib/mylib-utils.lua ./mylib/mylib-helpers.lua ./mylib/…

lua require coronasdk
Lua - merge tables?

I need to merge two tables, with the contents of the second overwriting contents in the first if a given …

merge lua lua-table
Define default values for function arguments

In the Lua wiki I found a way to define default values for missing arguments: function myfunction(a,b,c) …

function lua
Lua print on the same line

In Pascal, I have write and writeln. Apparently Lua's print is similar to writeln of Pascal. Do we have something …

lua
Lua need to split at comma

I've googled and I'm just not getting it. Seems like such a simple function, but of course Lua doesn't have …

lua split match
Concatenation of tables in Lua

ORIGINAL POST Given that there is no built in function in Lua, I am in search of a function that …

lua concatenation lua-table
Why do Lua arrays(tables) start at 1 instead of 0?

I don't understand the rationale behind the decision of this part of Lua. Why does indexing start at 1? I have …

arrays lua lua-table
lua: retrieve list of keys in a table

I need to know how to retrieve the key set of a table in lua. for example, if I have …

lua lua-table keyset
How can I embed Lua in Java?

Is LuaJava a must for this? Or can I embed Lua into Java without it?

java lua