comparison util/iterators.lua @ 4541:05f5ec99da77

Merge with trunk
author Matthew Wild <mwild1@gmail.com>
date Sun, 22 Jan 2012 22:55:49 +0000
parents a01b7207cb37
children c9b91ddc9c11
comparison
equal deleted inserted replaced
4530:40905e7bf680 4541:05f5ec99da77
138 end 138 end
139 139
140 -- Treat the return of an iterator as key,value pairs, 140 -- Treat the return of an iterator as key,value pairs,
141 -- and build a table 141 -- and build a table
142 function it2table(f, s, var) 142 function it2table(f, s, var)
143 local t, var = {}; 143 local t, var2 = {};
144 while true do 144 while true do
145 var, var2 = f(s, var); 145 var, var2 = f(s, var);
146 if var == nil then break; end 146 if var == nil then break; end
147 t[var] = var2; 147 t[var] = var2;
148 end 148 end