how much extra (compiled) space does an explicit assignment take?
It's not about the compiled space, it was about allowing people to take it out the box and start using the graphics right away with the minimum amount of boilerplate required.
reserving a single char variable name is a no-no for me... I tried to come up with a solution... but cannot really think of one.
var gfx = g;delete g;? Or just write your code such that the scoping means you don't overwrite the global g.
I can add Pixl.getGraphics() in a firmware update - or maybe E.getGraphics() makes more sense so it can be handled on other platforms as well. At least then it's not a big deal to just delete/overwrite the built-in g if you don't like it.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
It's not about the compiled space, it was about allowing people to take it out the box and start using the graphics right away with the minimum amount of boilerplate required.
var gfx = g;delete g;
? Or just write your code such that the scoping means you don't overwrite the globalg
.I can add
Pixl.getGraphics()
in a firmware update - or maybeE.getGraphics()
makes more sense so it can be handled on other platforms as well. At least then it's not a big deal to just delete/overwrite the built-ing
if you don't like it.