|
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 in Pascal? 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 to have?
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 [1], 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 most frequently?
[1] http://lua-users.org/lists/lua-l/2010-11/msg00479.html -- Best regards, Sergey Rozhenko mailto:sergroj@mail.ru