lua-users home
lua-l archive

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


On 2/26/08, Alexander Gladysh <agladysh@gmail.com> wrote:
> >  >  Continue contradicts with my understanding of single exit point idiom.
>  >
>  >  I think you meant "break", not "continue".
>
>
> Hmm. Break definitely. But continue too. Like this (silly example in C++):
>
>  for (int i = 0; i < 10; ++i)
>  {
>   if (i % 2)
>   {
>     continue;
>   }
>   printf("odd %d", i);
>  }
>

>  I treat continue in the first example as an another exit from the loop
>  iteration.

No it is not! The only exit point from the "for" loop above is the
condition "i<10".
"continue" simply causes to skip printf statement.

--Leo--