lua-users home
lua-l archive

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

> * Roberto Ierusalimschy:
> > Any comment about this?
> >
> >
> "until" could have been "break if", and the "repeat ... until exp"
> could have been "repeat ... break if exp end", where "repeat ... end"
> is an endless loop.

It is, and that is the problem. If you have repeat + continue, it
becomes this:

  repeat ... continue ... break if exp; end

With this interpretation, the continue goes to the end of the loop,
bypassing the "break if exp". This is not what most people expect
from continue.

BTW, this is completely parallel with while, which may read
as "repeat break if not exp; ... end". But this intepretation has
no problems with continue.

-- Roberto