lua-users home
lua-l archive

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


That won't be a problem as for locally scopes variables. Whether it is a good idea, not so sure.

Justin

On 8 Feb 2013 15:58, "Thijs Schreijer" <thijs@thijsschreijer.nl> wrote:
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