7 ms·
Grr. Expressions are hard: 10 LET a = 3+4*5 20 PRINT a, "\n" Produces the expected outcome: -> 23 Bug filed: https://github.com/skx/gobasic/is
by stevekemp 8y ago
Grr. Expressions are hard:
10 LET a = 3+4*5
20 PRINT a, "\n"
Produces the expected outcome:
-> 23
Bug filed:
https://github.com/skx/gobasic/issues/41 https://github.com/skx/gobasic/issues/41
- jacquesm 8y agoYes, but it should not require that LET statement. The expression evaluator looks subtly broken.
- stevekemp 8y agoBug filed, as per the edited comment above. I definitely agree this is wrong!
- tyingq 8y agoDon't know if it's the same bug, but "PRINT 1/0" returns 1. "PRINT (1/0)" prints nothing. Using "LET a=1/0" raises a div by zero error. Also, "LET a=1%0" panics.
- stevekemp 8y agoThe issue with the "PRINT 1/0" and "PRINT (1/0)" are the same as the previous one. LET a = 1/0 SHOULD produce a division by error, so I think that's correct. But 1%0 shouldn't panic. I'll fix that.
- jacquesm 8y agoThank you! At the airport and no access to my desktop so I could not run the code but I suspected that was going to cause a problem. Deskchecking ftw ;)