But since the result is not going to be reassigned from right to left, there is no conversion done.
Wrong. As would have said my professors, you can't compare tomatoes with bananas. Ther IS a conversion done: as correctly stated by Fullernator, 'test' is promoted to string before doing the comparison, thus yielding to a result that Malice didn't expect (ie an alphabetical comparison, not an integer comparison).In Blitz whenever you have an operator that operates on 2 values, values are promoted to the type of "most importance", where the order is as follows:
- int
- float
- string
(Note that ther is never any promotion from or to type instances).
Then, and only then, the operation is done.
Thus in the example of Malice, 'test' must indeed be promoted to a string before applying the '<' operator.
You can test this easily by modifying a bit the code
integer$="10" test=10As expected you will get "EQUAL", but now if you do
integer$="10 " test=10you will get "LESS", because the spaces at the end make the string "10 " be greater (in the alphabetic sense) than "10" (which is the conversion to a string of 10).