iterator for lists

This commit is contained in:
Glenn Maynard
2006-10-23 08:43:19 +00:00
parent 5216992b26
commit c955bde20c
@@ -33,6 +33,15 @@ function dofile(file)
return chunk
end
-- Like ipairs(), but returns only values.
function ivalues(t)
local n = 0
return function()
n = n + 1
return t[n];
end
end
-- (c) 2006 Glenn Maynard
-- All rights reserved.
--