[swift-evolution] [Returned for revision] SE-0077: Improved operator declarations

Anton Zhilin antonyzhilin at gmail.com
Thu Jun 23 08:18:19 CDT 2016

1. I've revised the proposal to mostly meet the recommendations.


2. My reaction to the rationale:

precedencegroup Foo {
  associativity: left
  strongerThan: Bar
  weakerThan: Bas

I agree with colons, but I would prefer above and below. Anyway, core 
team will have at least one more chance to change their mind.

- The proposal states that precedence groups live in a separate 
namespace from other declarations; however, this is unprecedented in 
Swift, and leads to significant implementation challenges. The core team 
recommends that precedence groups exist in the same namespace as all 
Swift declarations.

How unfortunate. We will need to discuss naming convention and try not 
to add too much visual clutter.

3. I also have a suggestion to discuss.

Under "Joining unrelated precedence groups" I see an algorithm that does 
not match anything I've seen in network theory.

My suggestion is to make it a warning, not an error. It will reduce the 
pressure on the language and compilers.

When we break down precedence hierarchy in a follow-up proposal, 
developers will be able to use a library that will join precedence 
groups and make their old code compile, although with warnings.

- Anton

More information about the swift-evolution mailing list