Closed ZornsLemma closed 7 years ago
This is the "expressiveness" of PLASMA ;-) Also, having to add ':' is one of my pet-peeves of Python. But I'll look at the value parser to validate.
So it's not a pretty fix but it should catch this case and similar errors.
Thanks Dave, much appreciated!
As a Python programmer I have a habit of writing ':' at the end of if statements by accident, as in the following PLASMA code:
Here I intended to compare i with 5, but I am actually comparing i with the contents of the word at address 5, because '5:' acts like '5:0' (i.e. access word 0 of a structure starting at address 5). This leads to hair-pulling, which I can ill-afford. :-)
Would it be possible to have the compiler generate an error here instead of implicitly using a value of 0 on the rhs of the colon operator? I don't believe this is ever done deliberately, as
doesn't return anything except false positives in the PLASMA repository.