[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: I'd give my right arm for a continue statement
- From: GrayFace <sergroj@...>
- Date: Sun, 23 Jan 2011 21:55:42 +0600
On 23.01.2011 18:42, David Kastrup wrote:
Not to mention all other languages.
It has never been a goal for Lua to emulate misfeatures.
What's your reasoning to call this a misfeature? Let's take Pascal as an
example, since it doesn't have that 'byproduct'. What's bad about this
I think Lua is supposed to be easily understandable, with minimum number
of gotchas and substandard continue-repeat combination is a huge gotcha.
My memory may be failing me about the patch, but I think this behavior
is *the* solution and the whole continue-repeat clash is a non-issue.
Could you give an example of a repeat-until construct where continue
jumping to the evaluation of the loop condition would be a useful thing
That's a hard thing. I rarely use repeat..until and in complex cases I
tend to use a 'while true' loop. So, no example for now.
When I think more of it, the behavior you suggest definitely has good
uses. It's basically the "redo" from Perl as I understood it from the
answer to Roberto's post , I've never worked with Perl myself. I
think "redo" may be useful in any loop, not just repeat..until.
Could someone familiar with Perl clarify in which loops "redo" is used
Sergey Rozhenko mailto:firstname.lastname@example.org