As always, link to the proposal: https://github.com/Anton3/swift-evolution/blob/operator-precedence/proposals/NNNN-operator-precedence.md
Without further ado, I changed syntax for declaring that an operator belongs to a group. It now looks like: infix operator <> : Comparative Next, I added a notion of default precedence group for infix operators: https://github.com/Anton3/swift-evolution/blob/operator-precedence/proposals/NNNN-operator-precedence.md#default-precedence-group Next, I added a notion of special operatrors that will allow nice declarations in the Standard Library: https://github.com/Anton3/swift-evolution/blob/operator-precedence/proposals/NNNN-operator-precedence.md#special-operators I have a question on this: is that right? Because corresponding operator functions still won't be declared anywhere. Now, I see only 1 large question/problem risen by David Waite: Should precedence relationships be defined inside or outside of precedence groups? That is: should we be able to add arbitrary relationships between existing groups? If we discuss this and no more problems are discovered, then I think, we will be ready for review. 2016-04-09 16:40 GMT+03:00 Chris Lattner <[email protected]>: > > On Apr 9, 2016, at 6:36 AM, Chris Lattner via swift-evolution < > [email protected]> wrote: > > I do think it is useful to be able to specify precedence relationships > without having to define a “group”, to avoid boilerplate when you have one > operator at a logical level (“??” for example). > > Thought there is the obvious counterpoint: sugaring this one case doesn’t > seem worthwhile, given how infrequently operators are defined. It is quite > reasonable to start simple and always require an operator to be a member of > a group. We could eliminate that boilerplate at some point down the road > if it is an issue in practice. > > -Chris
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
