4

The yul documentation states:

No “else” block can be defined.

It seems really weird. Yul has much more complex control flow schemes like loops and switches. Also other EVM languages like Solidity support the else blocks and they compile to EVM's jump opcodes just fine.

What's the reason behind this design decision?

CodeSandwich
  • 183
  • 1
  • 4

1 Answers1

0

ifs are used mostly for revert conditions, where the else is simply the continuation of the program. An if cond { a } else { b } pattern can be done via switch cond case 0: b default: a.

Leonardo Alt
  • 366
  • 2
  • 5