pack and unpack aren't working

I’m working through the Star Explorer Corona tutorial, but I’ve been changing up the code a bit. In some cases I’ve wanted to try the table.pack() and table.unpack() functions, but Corona keeps giving me errors, saying pack and unpack are nil fields. Can anyone explain this? Is Corona trying to use a previous version of Lua that doesn’t have those functions?

Have you tried to just use pack() / unpack() instead of table.pack() / table.unpack() ?

Great idea! That totally worked. By why? The reference manual says table.pack and table.unpack, and those are what work in the Lua demo.

Good news !

But you should take care, because Corona SDK uses LUA 5.1, not the latest version. So you should refer to LUA 5.1 to see what you can use and what you can’t.

As mentioned above, Corona uses Lua 5.1.

Lua 5.1 does *not* have a pack() function.  You’ll have to implement that yourself.

Lua 5.1 *does* have an unpack() function.  Note that it’s a global function in 5.1.

   https://docs.coronalabs.com/daily/api/library/global/unpack.html

Oh okay. I didn’t realize Corona uses 5.1. Thanks.

Have you tried to just use pack() / unpack() instead of table.pack() / table.unpack() ?

Great idea! That totally worked. By why? The reference manual says table.pack and table.unpack, and those are what work in the Lua demo.

Good news !

But you should take care, because Corona SDK uses LUA 5.1, not the latest version. So you should refer to LUA 5.1 to see what you can use and what you can’t.

As mentioned above, Corona uses Lua 5.1.

Lua 5.1 does *not* have a pack() function.  You’ll have to implement that yourself.

Lua 5.1 *does* have an unpack() function.  Note that it’s a global function in 5.1.

   https://docs.coronalabs.com/daily/api/library/global/unpack.html

Oh okay. I didn’t realize Corona uses 5.1. Thanks.