When I run this code snippet in Lua (using PICO-8 if it helps)
a = {}
table.insert(a,1,'foo')
I get the error
Attempted to index global "table" (a nil value)
According to the Lua website, this should work (https://www.lua.org/pil/19.2.html). What am I doing wrong?
Lua was unable to resolve the
tablepart oftable.insert. This is most likely because your host environment does not include the table standard library.As Lua is an "embedded" language, and most of its standard library is optional and may not be available if an environment decides to exclude it.
For PICO-8 in particular:
Source