[swift-evolution] [Proposal] Custom operators

Ben Rimmington me at benrimmington.com
Thu Apr 14 03:16:42 CDT 2016

Антон Жилин:
> No new suggestions have come in 2 days, and so I have created a pull request!
> https://github.com/apple/swift-evolution/pull/253

1. Assignment operators in Swift 2.2 have an `assignment` keyword:

infix operator += {
  associativity right
  precedence 90

2. If assignments can't be chained, should they be non-associative?

3. Instead of `precedencegroup`, I suggest an abstract declaration:

operator Multiplicative {
  precedence(> Additive)
infix operator * : Multiplicative

4. In your proposal, `NilCoalesting` should be `NilCoalescing`.

-- Ben

More information about the swift-evolution mailing list