You are reading a single comment by @Stev and its replies. Click here to read the full conversation.
  • As far as callbacks, if you do:
    function touch(x,y) {
    ...
    }
    require("Touchscreen").connect(touch);
    Then you can redefine the touch function, either by just entering it again, or by
    typing edit("touch").

    Hm. That's exactly what's not working (and the problem I meant when mentioning not being clear when copying function code vs referencing functions).

    When I do this like in your example above, I can edit the touch function, but it will not have any effect, as the original one seems to be "submitted" and stays active.

    If I instead use a double reference like

    function touch(x,y) {doTouch(x,y);}
    function doTouch(x,y) {console.log(x+"/"+y);}
    require("Touchscreen").connect(touch);
    

    , I can redefine doTouch effectively using edit().

    That's where I stumbled and wondered if I somehow could delete the original callback.

About

Avatar for Stev @Stev started