Pitch: Multi-statement if/switch/do expressions

A more conventional syntax:

  • Replace the outer .= with =
  • Replace the inner .= with bind

BE can be pronounced "binding expression".

The second example above becomes:

let first: Int? = for i in 0..<a.count {
  if found(a[i]) { bind i }
}
4 Likes