Ruby Random

Results 6 comments of Ruby Random

I am the OP, sorry for using wrong account, forgot to return to the one which is mine.

So, following code: ``` try TRY-BODY catch EXC-EXPR CATCH-BODY else ELSE-BODY finally FINALLY-BODY ``` Should compile to: ``` // these are hoisted to the top of scope, and are common...

`canary$` and `ec$` only appear if there is `else` clause. When there is no `else`, there is no need in those, and JS output should be the same as in...

Or, as @vendethiel suggested, just assign `thrown$ = true;` inside `catch` clause: ``` // these are hoisted to the top of scope, and are common for all `try` within scope...

@impinball `try`/`else` syntax is pretty straightforward for Python users, as Python provides `else` clause for most flow control constructs (`if`, `try`, `while`, `for` etc.) to indicate "successful, non-breaked, non-errored completion"....

@kkirby yes, `thrown$` is the way to go. I don't know what was in my mind when I suggested sentinel/canary object approach, maybe I just forgot that new variables can...