[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Next Version of Lua?
- From: Peter Cawley <lua@...>
- Date: Fri, 19 Jun 2009 17:00:00 +0100
On Fri, Jun 19, 2009 at 4:51 PM, Hisham<email@example.com> wrote:
> This would make 'continue' mean "jump to the top", and would be
> consistent with 'while' and 'for'.
In C, in a 'while', 'continue' jumps the remainder of the loop body
and to the condition. The condition is at the top of the source, but
it's not the top of the loop body. Again, in C, in 'for', 'continue'
jumps to the counting expression and then onto the condition. I tend
to visualise the counting expression at the bottom of the loop body,
even though it is specified above the loop body. Thus the norm is for
'continue' to jump to the condition, and skipping the condition for a
'continue' in a 'repeat' would break this norm.