News for hackers. Stuff that matters.
Re:The Bagel Language by brundolf on Monday September 20, 2021 @08:42PM (#28600808)
Addendum: I gave this some more thought and realized that actually, even as I have the compiler implemented right now, the else clause above is redundant because an expressive if/else with no else defaults to nil for that case:

  const z = if (x != nil) { x + 2 } // comes out to number|nil
So that's less verbose and may be acceptable as-is. You also shouldn't need to chain the syntax for multiple values:

  const z = if (x != nil && y != nil && z != nil) {
    x + y + z
  }
There may also be room to make the () optional like Rust does, or maybe just dropping the {} would be better. I'll have to see how each affects parsing and readability

There are no comments on this comment yet.