Closed boonto closed 5 years ago
For ev3dev this is the impl: https://github.com/OpenRoberta/robertalab-ev3dev/blob/develop/roberta/BlocklyMethods.py Lots of them are one-liners. Inlining them makes a lot of sense. For the more complex ones we could emit the helper function as needed and call it. Getting rid of the class in the long run makes a lot of sense to me.
Python observations: Microbit:
EV3dev:
NAO:
Vorwerk/Raspberry:
For python almost everything can be pulled up to the generic code gen visitor.
For Python: blockly_methods_all_robots.zip For C: NEPO_all_robots.zip
Implemented for Python, the helper methods are saved in a YAML file for now. If necessary, it can be split into individual language files later (Python only needs 3 helper methods).
Individual robots may override higher up implementations of methods.
Will be continued in #230.
tested on microbit and ev3dev
@VinArt please fix this
In Java and Python code generation we use
BlocklyMethods
for list and math operations. In the course of #1011 the list operations inBlocklyMethods
will be replaced by inline code or readable methods in the program. As there is (currently?) no discernible reason why we should use the non-transparentBlocklyMethods
, e.g.BlocklyMethods.sin(x)
instead of simplyMath.sin(x)
, all of these calls should be replaced. This will also increase readability and accessibility of the generated code.