4 ms·
Apart from general fitness for embedding and extending, I like the versatility of Lua tables: https://www.lua.org/pil/3.6.html https://www.lua.org/pil/3.6.html
by rch 10y ago
Apart from general fitness for embedding and extending, I like the versatility of Lua tables:
https://www.lua.org/pil/3.6.html https://www.lua.org/pil/3.6.html
In particular, to initialize a table to be used as a record:
a = {x=0, y=0}
which is equivalent to:
a = {}; a.x=0; a.y=0
and:
a.x = nil -- removes field "x"
But I think Guido's right about 0-based indexing:
http://python-history.blogspot.com/2013/10/why-python-uses-0-based-indexing.html http://python-history.blogspot.com/2013/10/why-python-uses-0...
- strainer 10y agolocal a = {x=0,y=0} --lua table definition is very similar to var a ={x:0,y:0} //javascript object definition Lua is great but that 1-based indexing is very unfortunate - works fine in itself but clashes badly with the norm.