lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


While writing some code, something popped up; do not use '_' as the name for your function (as you did in your sample code). In Lua it is mostly used as a placeholder for unused variables, so it will get you some very subtle and hard to track bugs later on.

Eg.

for _, val in ipairs(myTable) do
  print(val)
end


Thijs