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

L. Mihalkovic laurent.mihalkovic at gmail.com
Thu Jun 23 12:12:10 CDT 2016

Has a meta-circular syntax been considered for the precedence group definitions? Aside from limiting the proliferation of new keywords, it would also make them discoverable by reflection when the api gets added in 4.0. My apologies if it was already discarded.
(From mobile)

> On Jun 23, 2016, at 3:18 PM, Anton Zhilin via swift-evolution <swift-evolution at swift.org> wrote:
> 1. I've revised the proposal to mostly meet the recommendations.
> https://github.com/Anton3/swift-evolution/blob/master/proposals/0077-
> operator-precedence.md
> 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
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

More information about the swift-evolution mailing list