I am reading a few tutorials on Lua and am trying to figure out how to use unpack(). I found an example that goes like this:
t = { "the", "quick", "brown" }
print (unpack (t))
The output should be "the quick brown".
What actually happens is this: "stdin:1: attempt to call a nil value (global 'unpack')".
How can I make unpack() work?
My Info:
OS: Mac OS 10.8
Lua: 5.4.2
Since Lua 5.2 unpack function is now at table.unpack
Function unpack was moved into the table library and therefore must be called as table.unpack.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With