The order of operations appears inconsistent with the 1.26 manual in expressions involving MOD. I have yet to check other operators closely. Without the parens, it appears addition's precedence is higher:
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
confirmed. Hm. I have not checked it. Looking at the X11-Basic parser, the precedence is like folowing (lowest first):
comma
OR
AND
NAND
NOR
XOR
EOR
EQV
IMP
MOD
DIV
NOT
=, <>, >,<,<=,>=
+,-
*,/,^
+,- (sign)
(,)
I see this is completely different from what was stated in the manual (and maybe how It should be. Looks like a real problem, because I am not even sure is the compiler and the interpreter do it exactly the same.
So my suggestion would be, make sure, that it is the same in the compiler and then just change the manual and not change the language (since this would probably break compatibility to existing BASIC programs). WHat do you think?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Not breaking existing code assets is the main thing, that and consistency between the interpreter and compiler. The rest of us green-fielders writing new code can use parentheses and keep the manual open in the background.
EDIT: Yes, I am still rather sore about the VB6 to VB.NET thing, nearly 20 years later.
Last edit: Yet Another Troll 2019-06-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The order of operations appears inconsistent with the 1.26 manual in expressions involving MOD. I have yet to check other operators closely. Without the parens, it appears addition's precedence is higher:
confirmed. Hm. I have not checked it. Looking at the X11-Basic parser, the precedence is like folowing (lowest first):
comma
OR
AND
NAND
NOR
XOR
EOR
EQV
IMP
MOD
DIV
NOT
=, <>, >,<,<=,>=
+,-
*,/,^
+,- (sign)
(,)
I see this is completely different from what was stated in the manual (and maybe how It should be. Looks like a real problem, because I am not even sure is the compiler and the interpreter do it exactly the same.
So my suggestion would be, make sure, that it is the same in the compiler and then just change the manual and not change the language (since this would probably break compatibility to existing BASIC programs). WHat do you think?
Not breaking existing code assets is the main thing, that and consistency between the interpreter and compiler. The rest of us green-fielders writing new code can use parentheses and keep the manual open in the background.
EDIT: Yes, I am still rather sore about the VB6 to VB.NET thing, nearly 20 years later.
Last edit: Yet Another Troll 2019-06-08