-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arithmetic expression bug #28
Comments
Is there a |
@rhaberkorn Yes, these are extended operators and by default enabled, also they have operator precedence and that is also enabled by default https://github.com/fpjohnston/TECO-64/blob/master/doc/oper.md although the expression parser seem hand written and complicated so I don’t feel like to debug into it for now. |
Interesting, although of little help unless you also have short-cut AND/OR operators as |
TECO64 also introduced operator precedence and associativity (just like SciTECO). But this will also break compatibility with TECOC. Just saying... |
I found having In the
To make it runs faster, I rewrote it as
For this particular combination, I did used a SMT solver to prove this does not give unintended behavior from integer overflow of multiplication (assume And the speed up of squish macro after this rewrite is about 20% running on TECO-64 (the comparison is done for both version squished). The speed up is not only from saved And after I found the use of
They do not improve the expressiveness of the language by a lot, but does useful for a programmer who does micro optimization.
The extended operators is only recognized inside
Several flags are provided to control the incompatible features including the extended operators, but @fpjohnston decides to have the incompatible features enabled instead of off by default, maybe to encourage users to try out the new features.
I guess that requires the parser to do look ahead. If you provide other means to logically combine multiple comparison results then this is also not needed. |
Yes, some kind of lookahead would be required. But this means that an interactively typed You can of course now already write something like |
Another thing to consider in language design: Having flags influencing parser behavior immediately makes your language unparsable (because of the halting theorem) for any purpose like reliable syntax highlighting or even control flow. |
The last three expressions should give
-1
(true)this problem is specifically with variable in the form
nA
as other variables such as(Z==Z)
does give expected results.The text was updated successfully, but these errors were encountered: