A design that subsumes the various syntactic forms of

  • if statements/expressions
  • switch on values
  • match on patterns and pattern guards
  • if-let constructs

and scales from simple one-liners to complex pattern matches.

    • socOP
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      4 days ago

      Good catch, that should have been if person in the first line.

      It’s been a left-over from when syntax looked like this:

        is Person("Alice", _)$person then "{$person.age}"
        is Person("Bob", $age)       then "$age"