[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Next Version of Lua? (continue)
- From: Richard Hundt <richardhundt@...>
- Date: Wed, 10 Jun 2009 21:53:59 +0200
Roberto Ierusalimschy wrote:
Every person I train in Lua asks me why 'continue' doesn't work. I show
them the "equivalent", and it never meets with any kind of satisfaction.
I'm in the camp where I see a real need for it in Lua, not only for
clarity, but because it is a very useful loop construct that anyone
coming from another popular (scripting) language will expect to be able
Any comment about this?
My expectations are that the difference between the `repeat' and `while'
loop constructs should simply be that `repeat' evaluates is block before
testing the condition, whereas `while' does the inverse. I find it
surprising that the variable in the `until' condition is inside the
scope of the loop block.
So my vote would be to add `continue', but hoist the scope of the
`until' condition outside the block to make it behave like `while'.