What would be pretty awesome would be the ability to access the current block in question (its stored version, not its temporary / runtime version). This would allow people to add code that executes directly onto the block when it is called, as well as give it special attributes (like selector
to call builtin functions). An example would be:
myblock %stuff
run (JS function ((object) <>) {(object.source = stuff => console.log(stuff))}) with inputs: (custom block) <>
myblock (stuff)
where the last call would be overridden.
or:
new local variable %var
run (JS function ((object) <>) {(delete object.source; object.selector = "addVariable")}) with inputs: (custom block) <>
new local variable (var)
where the selector switches from evaluateCustomBlock
to addVariable
Another alternative would be JS defined blocks which would be much like the former.