lua-users home
lua-l archive

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


2014-03-26 14:06 GMT+02:00 David Demelier <demelier.david@gmail.com>:

> I hope you will still reconsider adding continue keyword to Lua and it will
> be perfect.

At present one can already do this:

for i=1,10 do for j=i,10 do
   if test1(i,j) then goto out
   elseif test2(i,j) then goto next_i
   elseif test3(i,j) then goto next_j
   end
   -- do a lot of work
::next_j:: end
::next_i:: end
::out::

`continue` can replace `goto next_j` only. Not enough to justify a keyword.