Log In  

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...)

P#76123 2020-05-08 13:42 ( Edited 2020-05-08 13:42)

Also I have discovered that the BBS has a hard time with a single pipe enclosed in backticks — the inline code span runs to the end of the paragraph.

P#76124 2020-05-08 13:43

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...

P#76128 2020-05-08 14:32

Thanks, didn't even realize there'd been another release already!

And, ah, that's a shame. I wish we could stop inheriting mistakes from half a century ago, but compat with stock Lua is definitely more important.

P#76129 2020-05-08 14:33

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

P#93836 2021-06-22 01:05

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 13:38:33 | 0.007s | Q:16