Noob: don't understand usage of curly brackets in if-statement

As I said, there’s a difference between expressions (paranthesis) and functions (braces).

if(true, x = x + 1, { y = y + 1 })

Here the first argument is an expression and the second argument is a function. The braces are not optional!

You can actually see it in the byte code:

  1. push true
  2. evaluate the expression x = x + 1 and push the result on the stack = ARG1
  3. push the function { y = y + 1 } on the stack (don’t evaluate it!) = ARG2
  4. call the if method on true with ARG1 and ARG2 as arguments
  5. if will evaluate ARG1 (does nothing) and return it. ARG2 is discarded (= short circuiting).

Again, the if method itself always short-circuits.