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

Антон Жилин antonyzhilin at gmail.com
Wed May 18 04:29:26 CDT 2016

I underline that I very much rely on the Core team to pick the "right"
version of syntax.
The only opinion I have is that `greaterThan` and `above` are probably
better than `>`.

- Anton

Trent Nadeau wrote:

> Although I would prefer something like:
> precedence(greaterThan: LogicalAnd)
> to:
> precedence(> LogicalAnd)
> I think the latter is more difficult to read, and I just find the idea of
> using an operator in an operator/precendencegroup definition strange.

Xiaodi Wu wrote:

> * `precedencegroup` defines both associativity and precedence, so the
> naming isn't great. Maybe `operatorgroup`?
> * I'm not sure about the parentheses used between the braces. To me, it
> would fit better with the language to use colons.
> * It may be confusing that relative precedence levels are themselves
> described using operators or words that describe operators. I'd suggest
> simpler words that aren't self-referential, such as "above" and "below".
> So to put it all together, here's the color of my bikeshed:
> ```
> operatorgroup Comparative {
>   associativity: left,
>   precedence: above(LogicalAnd)
> }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160518/2e8e1161/attachment.html>

More information about the swift-evolution mailing list