[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 13:06:20 +0100
Roberto Ierusalimschy <roberto@inf.puc-rio.br> writes:
>> >> 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.
>> >
>> > [...]
>>
>> Depends on whether the next token is "end". [...]
>
> To work as break/return, 'else', 'elseif', and 'until' should also
> be accepted:
Oh.
> That would result in this:
>
> repeat repeat until true -- ??
Yup. Sorry, did not realize that. Saving a reserved word does not seem
worth a new shift/reduce conflict or a new statement placement
restriction, so this particular naming idea appears to be out.
Different semantics in repeat-until from the C semantics (and strictly
speaking, C does not have something called repeat-until anyway) for
"continue" are something I continue to claim as useful.
"reloop" might be somewhat safe as a name. Given the constant clamor
for "continue", it is likely that people have refrained from using this
particular identifier, too.
"loop" is likely unused as well, but it seems more appropriate to use
this for something opening a new loop rather than iterating in an
existing one.
--
David Kastrup
- References:
- 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
- Re: continue/repeat...until false dichotomy, David Kastrup
- Re: continue/repeat...until false dichotomy, Roberto Ierusalimschy