luajit2
luajit2 copied to clipboard
not correct of the isarray function example
current isarray function example is
local isarray = require "table.isarray"
print(isarray{"a", true, 3.14}) -- true
print(isarray{"dog" = 3}) -- false
print(isarray{}) -- true
That is not the correct lua syntax. It should be
local isarray = require "table.isarray"
print(isarray({"a", true, 3.14})) -- true
print(isarray({dog = 3})) -- false
print(isarray({})) -- true
@damonchen
thanks for your report.
this change {"dog" = 3} => {dog = 3} should be good engouh since the () can be ommited.
Will you help to create a PR for it? thanks :)
No, it's correct the way it is now. Lua doesn't require parentheses when calling functions with a table constructor as an argument.