lua-users home
lua-l archive

Re: ipairs in Lua 5.3.0-alpha

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


On Aug 16, 2014, at 12:05 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 
> for k,v in ipairs(tbl) while ok(v) do
> end
> 
> and
> 
> for k,v in pairs(tbl) if ok(v) do
> end
> 
Presumably syntactic sugar for (in the while case):
for k,v in ipairs(tbl) do
	if not ok(v) then break end
	...
end
Doesn’t seem to buy much, and I don’t like the “if” version, it seems clumsy to read.
—Tim

AltStyle によって変換されたページ (->オリジナル) /