lua-users home
lua-l archive

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


> Given the prevalence of "iterate over the values only" in many
> languages, it is a bit odd that Lua doesn't have it.
>
As always, Lua provides the soup and the spoon, but you have
to do your own feeding.

ivalues = function(tbl);
   local k=0
   return function() k=k+1; return tbl[k] end
end