Rexxref 2.4 DO, note 9, says:
[...] Similarly, TO, BY, and FOR cannot be used in expri, exprt, exprb, or exprf. [...] However, parentheses around or within an expression can prevent these keywords from terminating an expression.
This does not work when TO, BY or FOR are used as variable reference terms. For example, in
to = 3
Do i = >to to 4
Say i
End
line 2 should produce an error, because the first "to" token should be taken to be a reserved sub-keyword, and then expri would be ">", which is an invalid expression.
My impression is that the interpreter should be fixed to honor note 9. Otherwise, this special behaviour should be documented.
Anonymous
I think I have to agree with Josep in this case. Consider the following:
do i = a~to to 6; say hi; end
Oooops ! ... try again. String or symbol expected.
String or symbol expected after tilde (~).
The TO is recognized as being a reserved word and thus an expression
terminator even though it is part of a message term just like >to would be.
I actually prefer the way ">to" is working currently, but both cases should
be working the same way.
On Mon, Sep 2, 2024 at 12:42 PM Josep Maria Blasco jmblasc2@users.sourceforge.net wrote:
Ticket moved from /p/oorexx/bugs/1974/
Can't be converted:
updated rexxref with [r12892] to clarify reserved DO/LOOP keywords can be used in certain terms even without parens.
also opened [feature-requests:#844] Allow reserved keywords in DO/LOOP expression message terms
Related
Commit: [r12892]
Feature Requests:
#844