Why is this function valid julia syntax?

I guess because:

  1. return ... is a valid Julia expression, i.e. it can be combined with other expressions. This is very convenient e.g. in REPL.
  2. Assignment happens after the return and thus is effectively unreachable.
7 Likes