This:
a += b >>> c |
Appears to evaluate as:
a = (a + b) >>> c |
Which is not expected. :)
(Incidentally, the precedence of the custom operators isn't documented, and it surprised me that bit ops are looser than addition — since they're effectively multiplication/division. I know this is the precedence in C, but C's bitop precedence is completely wacky and was forced by its predecessor's use of | and & for both bitwise and logical operations in 1967! Alas, existing carts...)
this was fixed in 0.2.0h
I'm with you on the silly c precedence. sad thing is, lua did the same (Lua operator precedence)
that would be nice for pico8 to "fix" it (if only for tweetcarts), but it's also nice to keep some standard lua compatibility...
Was looking for info about operator precedence — manual still doesn’t say much (or anything) but there is a doc here: https://pico-8.fandom.com/wiki/Lua#Operator_priorities
[Please log in to post a comment]