load() parameters

Posted on
  • I get that we won't have persistent variables for good reasons, but maybe we could pass values when calling load()?

    The first case I'm thinking about would the messages app: it would be nice if incoming "music" could be passed directly into the app, instead of writing it to flash and reading it back inside the app.

    And in general it might be nice if you could directly tell an app to load a specific screen.

  • Thanks - yes, I can see that could be a good idea.

    The problem we have right now is that between apps literally everything gets torn down - including variables. So I guess to pass anything, Espruino would have to convert it into a string (JSON?) store that on the stack, and then pass it back in...

  • Espruino would have to convert it into a string (JSON?) store that on the stack, and then pass it back in

    Maybe restrict it to passing a string, and just make apps handle converting to/from JSON if they need to? That way Espruino doesn't need to handle conversion failures, and extending it later to allow more/complex values won't break anything.

  • Good point, yes...

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

load() parameters

Posted by Avatar for rigrig @rigrig

Actions