You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • Yes, while it looks sensible, what you did in fact does not makes sense in event based system like espruino. The while block is useful only for short code that finishes quickly and not with true condition and not with any wait inside.

    Your blocks would translate well to e.g. micropython. Yes it is confusing and your case perfectly shows how those blocks are hiding the true nature of event based javascript and Espruino. The first generated code is in fact complete nonsene, which is not your fault. Your fix is well meant but not really helping, check e.g. this explanation

    Maybe the block->code generation could be much smarter to create illusion that this works but it looks like currently it is not clever enough.

About

Avatar for fanoush @fanoush started