lua-users home
lua-l archive

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


On Thu, Jun 7, 2012 at 3:02 PM, joao lobato <btnfdp.lobato@gmail.com> wrote:
> You can't break out of that for-loop. Those kind of constraints shape your
> solutions in ways that can easily make them suboptimal both in time/memory
> and ease of reading.

On the flip side, knowing that you cannot break out could make it
easier to read. A general for-loop could do all sorts of odd things,
so you (in general) need to read the entire body to understand what
might happen. For more specialised / sugared types of loop, reading
the header is sufficient to understand that nothing crazy is going to
happen.