[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: continue/repeat...until false dichotomy
- From: David Kastrup <dak@...>
- Date: Thu, 18 Feb 2010 09:41:37 +0100
Mark Hamburg <mark@grubmah.com> writes:
> On Feb 17, 2010, at 9:39 AM, David Kastrup wrote:
>
>> By the way, it would also be possible to just use "repeat" which already
>> is a reserved word. If its use is restricted to the same places where
>> "break" and "return" are allowed, I don't think that there is syntactic
>> ambiguity.
>
> Maybe not with a little extra lookahead, but if you see:
>
> if not_ready() then repeat
>
> What are you in the midst of parsing?
Depends on whether the next token is "end". I think that something like
repeat
dothis
dothat
if something then repeat end
dothis
until condition
is pretty legible.
Also
while condition do
dothis
dothat
if something then repeat end
dothis
end
does not look all too confusing to me. And it accomplishes both the
goal to make clear that "repeat" is not "continue" and not to need
another keyword.
Regardless of which keyword is used, I repeat my proposal to make
"continue" under whatever name resume at the top of a repeat loop, not
the condition.
That not just avoids the scope problems, but is quite more useful in
practice.
--
David Kastrup
- References:
- Re: continue/repeat...until false dichotomy, Florian Weimer
- Re: continue/repeat...until false dichotomy, Kelley, Brian
- Re: continue/repeat...until false dichotomy, Matthew Wild
- Re: continue/repeat...until false dichotomy, Kelley, Brian
- Re: continue/repeat...until false dichotomy, Matthew Wild
- Re: continue/repeat...until false dichotomy, David Given
- Re: continue/repeat...until false dichotomy, David Kastrup
- Re: continue/repeat...until false dichotomy, Mark Hamburg
- Re: continue/repeat...until false dichotomy, David Kastrup
- Re: continue/repeat...until false dichotomy, Majic
- Re: continue/repeat...until false dichotomy, David Kastrup
- Re: continue/repeat...until false dichotomy, David Kastrup
- Re: continue/repeat...until false dichotomy, Mark Hamburg