Lonami / pyndustric

A Python compiler for Mindustry's logic processors assembly language
MIT License
49 stars 9 forks source link

Allowing mindustry's function ops like abs() and sin() #31

Closed TelosTelos closed 3 years ago

TelosTelos commented 3 years ago

Our code has handled binary ops like +, *, and -, but not the various other mindustry functional ops , like abs() and sin().

My current version allows all of them (at least all ones you can select via the in-game editor), though it simple-mindedly converts whatever given args there are via as_value and passes them to the function, with no checking for type or even number of arguments. Let's pretend that that's my firm commitment to Pythonic duck typing, and not just laziness...

It may be good to add these all to the .pyi at some point (though doing so would overwrite many Python functions, so maybe we shouldn't, except maybe in cases where the mindustry one behaves differently, or doesn't have a pure Python analog).

Lonami commented 3 years ago

This was fixed by https://github.com/Lonami/pyndustric/commit/a01382c285e0bf284530b2faf53b60dcf716d268.