lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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