[swift-evolution] [Review] SE-0077 v2: Improved operator declarations

Anton Zhilin antonyzhilin at gmail.com
Fri Jul 1 11:36:22 CDT 2016

Joe Groff via swift-evolution <swift-evolution at ...> writes:

> To reiterate the core team's rationale, precedence groups ought to be a 
relatively rare thing. Few users
> ought to be defining new operators, fewer still new precedence groups. 
Furthermore, the '-Precedence'
> word clarifies the use site in an operator decl:
> 	infix operator ΒΆ : PilcrowPrecedence
> making it clear that the ':' is associating a precedence with the 
operator. Since operator decls are
> themselves hopefully rare as well, this added clarity should hopefully 
save unfamiliar users a trip to
> Stack Overflow.

Nice explanation, I start to agree that these suffixes are not just 
necessary evil, but something that can really help.

I also don't know where to put it, so I will here.
I understand reasons for not taking 'precedence' keyword, but still very 
much like this variant. Together with -Precedence suffix, it can form 
complete analogy with protocols.

I find the argument that precedence groups are less significant that 
protocols not convincing enough. In APIs, we will still be able to use it, 
as we can use 'protocol' and 'default' after dot without escaping.

More information about the swift-evolution mailing list