Corona SDK, table.pack()

I am a new user of Corona Outlaw IDE.  Everything is going smoothly, but for some reason it does not recognize the table.pack() function.  It works fine with the table.unpack() function.  I am using the latest version of Outlaw.
 
The author of the book I am reading stated that the table.pack() function was newly added to Lua 5.2.  So, how can I install this function to my Outlaw IDE?
 
Thanks,
James Ogletree
j.a.ogletree@gmail.com

Can you be more specific?  Are you getting lua errors from Corona SDK when you try to run your app, or is Outlaw just not doing things like code completion with it?

Can you be more specific?  Are you getting lua errors from Corona SDK when you try to run your app, or is Outlaw just not doing things like code completion with it?

I am seeing the same bug using 2013.1202.

table.pack generates this error: “Attempt to call field ‘pack’ (a nil value)”

table.unpack generates this error: “Attempt to call field ‘unpack’ (a nil value)”

Using just unpack() does work.

Using just pack() gives this error: “Attempt to call global ‘pack’ (a nil value)”

Are these not implemented?

I think table.pack and table.unpack are part of Lua 5.2, but Corona uses Lua 5.1.  In Lua 5.1, unpack is a predefined function (like print).  You can see by comparing the Lua 5.1 and 5.2 manuals: http://www.lua.org/manual/5.1/manual.html and http://www.lua.org/manual/5.2/manual.html.

  • Andrew

There is pack() and unpack() - not table.pack() or table.unpack(), if you want to use functions in Corona

I am seeing the same bug using 2013.1202.

table.pack generates this error: “Attempt to call field ‘pack’ (a nil value)”

table.unpack generates this error: “Attempt to call field ‘unpack’ (a nil value)”

Using just unpack() does work.

Using just pack() gives this error: “Attempt to call global ‘pack’ (a nil value)”

Are these not implemented?

I think table.pack and table.unpack are part of Lua 5.2, but Corona uses Lua 5.1.  In Lua 5.1, unpack is a predefined function (like print).  You can see by comparing the Lua 5.1 and 5.2 manuals: http://www.lua.org/manual/5.1/manual.html and http://www.lua.org/manual/5.2/manual.html.

  • Andrew

There is pack() and unpack() - not table.pack() or table.unpack(), if you want to use functions in Corona