jamiebuilds / ghost-lang

:ghost: A friendly little language for you and me.
302 stars 10 forks source link

Switch block #17

Closed aleclarson closed 5 years ago

aleclarson commented 5 years ago

Thoughts?

let foo = switch (bar) {
  == 0 { 0 }
  == 1 {
    continue // explicit fall-through
  }
  > 1 {
    continue 0 // re-evaluate the switch
  }
  else {
    // default block
  }
}

Not sure if I prefer the conditions with/without parens.

jamiebuilds commented 5 years ago

Eh, it doesn't add much value, it just adds syntax